Print Cell Height And Cell Width Of A Cell In Excel

In this post we will see how to get cell height and cell width value in a cell in excel.

We will use cell’s height and width properties in VBA to get the dimension of cell i.e. row and height.

Below is a cell and we are showing its height and width in terms of excel size in the cell




Excel showing row height and width are displayed in a cell

Step 1

Open VB editor from Develop the workbook in which we will write the code to get the dimension of the cell in terms of its weight and width

Open developer tab to write VBA to find cell dimension

Step 2

Insert a module in which we will the VBA code.

Insert a module in the VB editor

Step 3

Now double click the newly created module to open that and paste the below code in the module.




Sub Get_Range()

Dim r As Range

Set r = ActiveSheet.Range(“A1”)

Range(“A1”).Value = “Width= ” & r.Width & ” ” & “Height= ” & r.Height

End Sub

Code to get row's height and width of a cell

This code will leverage width and height properties of range class and write the value of cell’s height and width in cell A1.

You can loop through this program to get height and width of all the cells in a range.

Hope this helped.




Share The Knowledge

Random Posts

  • Hour From A Time In Excel

    Let’s see how to get the hour from time in excel. Hour () formula in excel returns a number from […]

    Share The Knowledge
  • Return Font Name And Font Size In VBA

    return font size i excel return font name inn excel, vba to find font size, vba to find font name, get font size in excel, get font name in excel

    Share The Knowledge
  • Second Maximum Value In Excel

    A very common interview question that is asked in an excel interview is to find the second maximum value in a […]

    Share The Knowledge
  • Remove Count Of From Pivot Table In Excel

    In pivot  when we aggregate values we get a little prefix “Count of” in the column name which sometimes is […]

    Share The Knowledge