Solved

Display the height of a given row in Excel

Posted on 2014-12-06
4
200 Views
Last Modified: 2014-12-21
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
0
Comment
Question by:WeThotUWasAToad
4 Comments
 
LVL 5

Expert Comment

by:Hakan Yılmaz
ID: 40485197
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

0
 
LVL 10

Accepted Solution

by:
Jamie Garroch earned 500 total points
ID: 40485395
You can also do it without VBA by using the old Excel function Get.Cell

It can't be used directly in the formula but you can do this:

1. From the FORMULAS tab, click Define Name
2. Set the name to RowHeight and in the Refers to field, enter =GET.CELL(17,A1) (17 is the Row Height property returned by the GET.CELL function and for others, see this article)
3. In cell A1, type =RowHeight

The row height will now appear in the cell but it won't update when the row height is changed. To overcome this we can add a trick to force the recalc by appending the formula with +0*NOW() so it's now:

=RowHeight+0*NOW()

The row height value will get updated on a recalc (F9 to force it).
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 40486515
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
0
 

Author Closing Comment

by:WeThotUWasAToad
ID: 40511875
Great! Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now