[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Display the height of a given row in Excel

Posted on 2014-12-06
4
Medium Priority
?
220 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 13

Accepted Solution

by:
Jamie Garroch earned 2000 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 34

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

830 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