How to know height of row in Excel?
>> Thursday, 14 June 2012
How to know height of row in Excel?
hello everyone,
I want to know height of row in cm as function CELL return width column...
Thanks a lot.
Reply With Quote
#2
Old 04-01-2012
Panop Panop is offline
Member
Join Date: Aug 2011
Posts: 460
Re: How to know height of row in Excel?
Be aware that the column width argument from the CELL function is in number of characters, not in CM.
To get row height in CM, you may use a User Defined Function.
* To enter this User Defined Function (UDF),
* opens the Visual Basic Editor.
* Ensure your project is highlighted in the Project Explorer window.
* Then, from the top menu, select Insert/Module and
* paste the code below into the window that opens.
* To use this User Defined Function (UDF), enter a formula like
Code:
=RowHeightCM([cell_ref])
in some cell.
If the optional cell reference argument is missing, the function will return the row height of the cell in which it was entered (like the CELL function). Note that the rowheight property is in points, and there are 72 points to an inch.
Code:
Option Explicit
Function RowHeightCM(Optional rg As Range) As Double
If rg Is Nothing Then Set rg = Application.Caller
RowHeightCM = rg.RowHeight * 2.54 / 72
Reply With Quote
#3
Old 04-01-2012
Go!pee Go!pee is offline
Member
Join Date: Aug 2011
Posts: 511
Re: How to know height of row in Excel?
You can also use the following VBA funcation to get the requirement of yours.
Sub Change_Header_Row_Height()
Code:
MsgBox "RowHeight = " & Range("A1").RowHeight _
& vbCrLf & "Height = " & Range("A1").Height
Range("A1").RowHeight = 90
End Sub
Reply With Quote
0 comments:
Post a Comment