Solved

Display the height of a given row in Excel

Posted on 2014-12-06
4
197 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
Comment Utility
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 9

Accepted Solution

by:
Jamie Garroch earned 500 total points
Comment Utility
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 31

Expert Comment

by:Rob Henson
Comment Utility
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
Comment Utility
Great! Thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

772 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

11 Experts available now in Live!

Get 1:1 Help Now