Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel cell default measure unit

Tags:

excel

vba

What is the default measurement unit of Excel cell size? Is it Point or Pixel or Millimeter ?

By default, excel cell Row height is 15, what is the meaning of this value? Is it 15 Pixels or 15 Points

By default, excel cell Column Width is 8.43, what is the meaning of this value? Is it 8.43 Pixels or 8.43 Points

If both row and column units are same, then Row height should be smaller than to column width. But the measurement is reverse, row height shows bigger number than column width. In Cell appearance also, row is small than column width.

enter image description here

I need to create box with Height 90 mm (millimeter) and Width 195 mm (millimeter). Please let me know what are values to be put in Row and Column textboxes.

Thanks in advance.

like image 314
Ravi Kannan Avatar asked Nov 17 '17 07:11

Ravi Kannan


2 Answers

The default units for column and row are indeed different when accessed through the GUI.

The displayed column width in the GUI refers to the Range.ColumnWidth property, where One unit of column width is equal to the width of one character in the Normal style. For proportional fonts, the width of the character 0 (zero) is used (source). This means as you change the worksheet style, your column width may change too.

The height, however, displays a normal height in points.

In VBA, you can both get both this font-related unit, and the normal point unit for the width. For the height, you can only get the value in points:

Debug.Print Range("A1").ColumnWidth '8.43 characters wide by default
Debug.Print Range("A1").Width '48 points wide by default
Debug.Print Range("A1").Height '12.75 points high by default

Of course, you can calculate a conversion factor between character width and points: Range("A1").Width / Range("A1").ColumnWidth = 5.69 when using Arial, 10 pt. This means that if you want to have a size of 195mm by 90mm, you need to enter 97.0777 as column width, and 255.118 as column height if you're using Arial, 10 pt as normal style.

like image 64
Erik A Avatar answered Sep 18 '22 13:09

Erik A


As per the Microsoft documentation....

You can specify a row height of 0 (zero) to 409. This value represents the height measurement in points (1 point equals approximately 1/72 inch or 0.035 cm). The default row height is 12.75 points (approximately 1/6 inch or 0.4 cm). If a row has a height of 0 (zero), the row is hidden.

Read it more here.

like image 23
Subodh Tiwari sktneer Avatar answered Sep 20 '22 13:09

Subodh Tiwari sktneer