Discussion:
row height
(too old to reply)
bing
2011-12-21 07:53:28 UTC
Permalink
hello everyone

I want to know height of row in cm as function CELL return width column

bing
Ron Rosenfeld
2011-12-21 13:00:13 UTC
Permalink
Post by bing
hello everyone
I want to know height of row in cm as function CELL return width column
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), <alt-F11> 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

=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.

===================================
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
End Function
============================
bing
2011-12-21 14:38:56 UTC
Permalink
thanks Ron

Loading...