Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Display the height of a given row in Excel

Posted on 2014-12-06
4
Medium Priority
?
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 12

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 33

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

650 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