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

  • Extract Numbers After A Character In Excel

    Let’s see how we could easily extract all the digits after a character in excel. There are several occasions in […]

    Share The Knowledge
  • Delete/Remove Pivot Table In Excel

    Let’s see how to delete a pivot table in an excel sheet. Sometimes we want to delete the existing pivot […]

    Share The Knowledge
  • Exclude Blank Dates From VLOOKUP Formula In Excel

    Exclude blank dates from being pulled in excel, exclude 00-01-1900 in vlookup from being shown in excel dates, vlookup remove 00-01-1900 from dates, exclude blank dates from vlookup formula

    Share The Knowledge
  • Area Function In Excel

    Area function is a very significant function when it comes to determine how many references have been selected in the […]

    Share The Knowledge