Link to home
Start Free TrialLog in
Avatar of WeThotUWasAToad
WeThotUWasAToad

asked on

Display the height of a given row in Excel

Hello,

Does Excel (2013) have a formula which displays the height of the row it's in (or width of its column)?

For example, the two functions:

        =ROW()
        =COLUMN()

display the row & column numbers of a given cell. I'm interested in finding the height & width (ie something like this):

        =HEIGHT()
        =WIDTH()

I realize the above functions do not exist but that's essentially what I'm after.

If Excel functions are not available, then is it possible using VBA?

Thanks
Avatar of Hakan Yılmaz
Hakan Yılmaz
Flag of Türkiye image

This may help.

Function Height(ByRef MyRange As Range)
    Height = MyRange.EntireRow.Height
End Function

Function Width(ByRef MyRange As Range)
    Width = MyRange.EntireColumn.Width
End Function

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Column width is available in the CELL function:

=CELL("width",CellRef)

If CellRef is left blank it will use the column in which it is placed.

This only gives the width as an integer, so if the width is set to 8.71 it will show 9.

Unfortunately, no such option within the CELL function for height.

Thanks
Rob H
Avatar of WeThotUWasAToad
WeThotUWasAToad

ASKER

Great! Thanks.