Tip: Other languages are Google-Translated. You can visit the English version of this link.
or

Register

or
0
0
0
s2smodern

## How to set cell size in cm (centimeters) in Excel?

On a worksheet, the default units for the row height and column width are preset, and the default column width is 8.38 characters and the default row height is 12.75 points. And in Excel, it is difficult for you to set the row height or column width in inches or centimeters. But, sometimes you need to change the height and width to centimeters for some purpose. How could you solve this problem?

Set cell size in cm (centimeters) with VBA code

#### Easily Combine multiple sheets/Workbook into one Single sheet or Workbook

To combinne multiples sheets or workbooks into one sheet or workbook may be edious in Excel, but with the Combine function in Kutools for Excel, you can combine merge dozens of sheets/workbooks into one sheet or workbook, also, you can consolidate the sheets into one by several clicks only.  Click for 60 days free trial!

### Tabbed browsing & editing multiple Excel workbooks/Word documents as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Excel workbooks or Word documents in one Excel window or Word window, and easily switch between them by clicking their tabs. Click for free trial of Office Tab!

You can’t set the height and width in centimeters with Excel’s functions, except for using VBA code. The below two codes can help you to set column width and row height. Do as follows:

1. Select the cells that you want to set them in centimeters.

2. Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following code into the Module:

Code for setting row height in centimeters:

```Sub RowHeightInCentimeters()
Dim cm As Single
cm = Application.InputBox("Enter Row Height in Centimeters", _
"Row Height (cm)", Type:=1)
If cm Then
Selection.RowHeight = Application.CentimetersToPoints(cm)
End If
End Sub```

3. Then click  button to execute the code. And a prompt box will pop out to tell you to enter a number of row height. See screenshot:

Note: the number you enter must be less than 15. And this VBA code won't change row height if you enter 0 in this dialog box.

4. Click OK. And the row height of the selected cells have been set with 2 centimeters. See screenshot:

If you want to set the column width in centimeters as well, you can input the following code:

Code for setting column width in centimeters:

```Sub ColumnWidthInCentimeters()
Dim cm As Single, points As Integer, savewidth As Integer
Dim lowerwidth As Integer, upwidth As Integer, curwidth As Integer
Dim Count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("Enter Column Width in Centimeters", _
"Column Width (cm)", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "Width of " & cm & " is too large." & Chr(10) & _
"The maximum value is " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "Width Error"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
Count = 0
While (ActiveCell.Width <> points) And (Count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
Count = Count + 1
Wend
End Sub```

#### Set cell size in cm (centimeters) with Kutools for Excel

With the above codes, you can only set cell size in centimeters, today, I will introduce you a multifunctional tool, Kutools for Excel which not only can set cell size in centimeters but also in inches, pound and pixels.

After installing Kutools for Excel, please do as below:

1.Highlight the cells that you want to set them in centimeters.

2. Click Kutools > Format > Adjust Cell Size, see screenshot:

3. In the Adjust Cell Size dialog box, choose the Unit type you need and specify the Row height and Column width from Set values section. See screenshot:

4. Then click OK or Apply. You will get cells with 2 cm row height and 3cm column width.

#### Set cell size in cm (centimeters) with Kutools for Excel

Related articles:

Set column width and row height for a range

How to square multiple cells in Excel?

### Recommended Productivity Tools

#### Office Tab

Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

#### Kutools for Excel

Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

200 New Features for Excel, Make Excel Much Easy and Powerful:

• Merge Cell/Rows/Columns without Losing Data.
• Combine and Consolidate Multiple Sheets and Workbooks.
• Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
• Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,

Say something here...
symbols left.
###### or post as a guest, but your post won't be published automatically.
• To post as a guest, your comment is unpublished.
· 3 years ago
Thank you. I used your idea to compare ColumnWidth and Width, and it was very helpful. I did this function in Object Pascal and want to share it with you. Thanks.

procedure ActiveCellColumnWidthInCentimeters(ExcelApp: Variant; CM: Double);
var
dColumnWidth, dWidth, points: Double;
begin
dColumnWidth := ExcelApp.ActiveCell.ColumnWidth;
dWidth := ExcelApp.ActiveCell.Width;
points := ExcelApp.CentimetersToPoints(CM);

ExcelApp.ActiveCell.ColumnWidth := ((points * dColumnWidth) / dWidth);
end;
• To post as a guest, your comment is unpublished.
· 3 years ago
Seems redundant.

Just go into the regular column size dialogue and add "cm" after typing the size.
• To post as a guest, your comment is unpublished.
· 4 years ago
Needed this badly. [b]Thank you so much![/b]
• To post as a guest, your comment is unpublished.
· 4 years ago
Wow - that is awesome! I needed to set cells to print at a certain size. I have never been able to figure out how to do that before. Yay for VBA!