How to Get Cell or Row Height in Excel Using Custom Functions
Question details
The user wants to know how to return the row height of a specific cell using a worksheet function in Excel.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Trying to calculate, display, or reference the exact height of a row or cell directly within a spreadsheet.
- Observed behavior
- Excel lacks a native built-in formula to directly return row height, requiring alternative methods like VBA or legacy functions.
Before you begin, ensure you have enabled the Developer tab in your spreadsheet and are comfortable opening the VBA Editor, as you will need to create a custom macro function or use legacy name manager settings.
Create a VBA User-Defined Function (UDF)
Write a simple VBA script to create a custom formula that returns the height of any selected cell.
Because Excel does not have a native row height function, creating a User-Defined Function in VBA is the most reliable method. The 'Application.Volatile' command ensures the formula updates when the sheet recalculates.
Open your Excel workbook and press Alt + F11 to launch the Microsoft Visual Basic for Applications (VBA) editor.
In the top menu, click Insert > Module to create a new blank code module.
Copy and paste the following code into the module window: Function RowHeight(rng As Range) As Double Application.Volatile RowHeight = rng(1).RowHeight End Function
Close the VBA editor. Go to any cell in your worksheet and type =RowHeight(A1) to return the height of cell A1.

Use the Legacy GET.CELL Function via Name Manager
Define a custom name using an old Excel 4.0 Macro function to retrieve cell properties without writing VBA code.
Create Custom Functions with WPS Spreadsheet
WPS Spreadsheet provides excellent support for VBA macros and User-Defined Functions, allowing you to easily create a custom row height formula just like in Excel. It is lightweight, fully compatible with Microsoft Excel formats (.xlsx, .xlsm), and free to use.
- 1. Open the VBA Editor: Open your workbook in WPS Spreadsheet, go to the Developer tab, and click on 'VBA Editor' or press Alt + F11.
- 2. Insert the VBA Code: Click Insert > Module, and paste the RowHeight VBA code into the code window.
- 3. Save as Macro-Enabled: Save your file as a Macro-Enabled Workbook (.xlsm) to ensure your custom function is preserved.
- 4. Use the Function: Type =RowHeight(A1) directly into any cell within your WPS Spreadsheet to extract the row height instantly.

Frequently Asked Questions
Why doesn't the cell height formula update automatically when I drag the row border?
Adjusting a row or column border with your mouse does not trigger Excel's calculation engine. Even with 'Application.Volatile' included in your VBA code, you must manually press F9 to force the worksheet to recalculate and display the new row height.
Is there a built-in formula to find cell height in Excel?
No, Excel does not have a standard built-in worksheet function like =ROWHEIGHT(). You must rely on custom VBA User-Defined Functions or the legacy Excel 4.0 GET.CELL macro function.
Can I use the cell height function on a multi-cell range?
Yes, but by default, the VBA function rng(1).RowHeight will only return the height of the very first top row within that selected multi-cell range.
Why am I getting an error when saving my workbook with GET.CELL?
The GET.CELL function is part of the legacy Excel 4.0 Macro system. To successfully save a workbook containing this function or any custom VBA code, you must save the file in the Macro-Enabled Workbook format (.xlsm).




