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
Solved

Display the height of a given row in Excel

Posted on 2014-12-06
4
202 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 11

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 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 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