View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Kieranz[_2_] Kieranz[_2_] is offline
external usenet poster
 
Posts: 55
Default Function for RowHt. How to create

On Apr 16, 8:25 pm, JE McGimpsey wrote:
One way:

Public Function RowHeight(Optional ByRef rng As Range) As Variant
Application.Volatile
On Error Resume Next
If rng Is Nothing Then Set rng = Application.Caller
On Error GoTo 0
If Not rng Is Nothing Then
RowHeight = rng.EntireRow.Height
Else
RowHeight = CVErr(xlErrRef)
End If
End Function

Called as

=RowHeight()

it returns the height of the active row, or you can reference another
cell/row:

=RowHeight(E7)

returns the height of Row 7.

In article om,





"Kieranz" wrote:
Hi All,
I would like to create a function to get the row height. Eg in cell B5
it should put the value of row B height. similar to =Cell("width") so
that if i type =RowHt() it should put the row height value in the
activecell.
Many Thks
KZ



Many thks, Mr McGimpsey. Exactly what i wanted. Qn What does
application.caller do? and CVErr(xlErrRef)
Rgds
KZ