How to Set the Same Height and Width in Excel Cells – 3 Methods

Method 1 – Making Excel Cells Equal by Pixels to Get the Same Height and Width

This is the sample dataset.

Initial Sheets to make Excel Cells Equal by Pixels to Get the Same Height and Width
Click on the image for better quality

Set all columns the same width in the worksheet. 

Step 1:

  • Click Select All =>  Home tab =>  Cells.
  • Click Format => Column Width.

Click on Select All button, go to Home and expand Format drop-down

Step 2:

  • Enter the value.

In the Column Width dialog box, Insert the desired value in Column Width field

Step 3:

  • Click OK.

This is the output. The width of all columns is 10.

Hitting OK in the Column Width dialog box to equalize all the cell widths within the sheet
Click on the image for better quality

To set all rows the same height. 

Step 4:

  • Hover your mouse over the right side of column A => Click and hold  => You will find the Pixel value of the column, 97 pixels.

Click on the right side of column A and remember the pixel value

Step 5:

  • Place the Cursor below Row 1 and drag it down => Keep track of the Pixel value => Release the Cursor when the Pixel value is 97 =>

You will see the cells within the sheet with the same height and width.

Place the Cursor below row 1, drag it down and release when the Pixel Value is 97

Note

We must set cells equal by Pixels. Making equal points is unable to create the same height and width.

Read More: How to Make All Cells the Same Size in Excel


Method 2 – Using the Scale Feature in Page Layout View to Make Cells the Same Height and Width

This is the worksheet.

Initial Sheets to make Excel Cells Equal in Height and Width using Page Layout Feature

 

Step 1:

Click Select All => Go to the View tab => In View, select Page Layout.

Click on Select All button, go to View and choose Page Layout

Note

The Page Layout view command is also available at the bottom-right corner of your workbook.

An alternative area to find the Page Layout view is the bottom-right corner of your workbook

Step 2:

You will see measuring scales above the columns and on the left side of the rows.

Output of enabling Page Layout View
Click on the image for better quality

Step 3:

  • Go to the Home tab=> click Format in Cells.
Go to Home, expand the Format drop down and choose Column Width
Click on the image for better quality

Step 4:

  • Click Column Width.
  • Enter 1.

Input 1 inch in the Column Width field

Step 5:

  • Click OK.

Cells width become 1 inch.

All the cell column widths become 1 inch

Step 6:

  • Click Format and choose Row Height.

Again expand the Format drop down and now choose Row Height

Step 7:

  • Enter 1.

Input 1 inch in the Row Height field

Step 8:

  • Click OK to see the output.

Using Page Layout Feature to Make Cells Same Height and Width

Read More: How to AutoFit in Excel


Method 3 – Using an Excel VBA Code to set Cells with Equal Height and Width

3.1 Same Height and Width Cells for the Entire Worksheet

Initial Excel Sheet to make Cells Equal in Height and Width within Entire Worksheet using VBA

 

Step 1:

  • Go to the Developer tab =>Select Visual Basic in Code.

Navigate to Developer and choose Visual Basic

Step 2:

  • Select Insert and click Module => Enter the following code in the module => Run.
Sub MakeCellsEqualHeightWidth()         With Cells(1, 1)         Cells.RowHeight = .Width         Cells.ColumnWidth = .ColumnWidth     End With End Sub

Insert the intended code to make Same Height and Width Cells for Entire Worksheet

Note

You can also open the VBA Editor window by pressing Alt+F11.

Step 3:

  • Go back to the sheet and see the result.

Output of running VBA to make same height and width cells for Entire Worksheet


3.2 Same Height and Width for Selected Cells

Consider A4:D7.

Initial Sheet to make Excel Cells Equal in Height and width for selected cells using VBA

 

Step 1:

  • Select  A4:D7  => Go to the Developer tab => Select Visual Basic.

Select the mentioned range, go Developer and choose visual basic

Step 2:

  • Select Insert >> click Module => Enter the code below in the module => Run.
Sub EqualizeSelectedRange()     Dim max_width     max_width = 0     Dim selectedRange As Range     Set selectedRange = Selection     For Each cell In selectedRange         If cell.Width > max_width Then             max_width = cell.Width         End If     Next cell     If max_width > 0 Then         aspect_ratio = max_width / selectedRange.Cells(1, 1).EntireColumn.ColumnWidth         For Each cell In selectedRange             cell.EntireColumn.ColumnWidth = max_width / aspect_ratio             cell.RowHeight = max_width         Next cell     End If End Sub

Insert the intended code to make Same Height and Width Cells for Selected Cells

Step 3:

  • Go back to the sheet and see the result.

Output of running VBA to make same height and width cells for Selected Cells

Note

3.3 Same Height and Width for a Used Range

Consider the Used Range A4:D7.

Initial Excel Sheet to make Cells Equal in Height and Width within Used Range using VBA

Step 1:

  • Go to Developer >> Select Visual Basic.

Go to Developer and choose Visual Basic to open VBA editor

Step 2:

  • Select Insert >> click  Module >> Enter the following code in the module >> Run.
Sub equalizeUsedRange()     Dim max_width     max_width = 0     Set ws = ThisWorkbook.ActiveSheet     For Each cell In ws.UsedRange         If cell.Width > max_width Then             max_width = cell.Width         End If     Next cell     aspect_ratio = max_width / ws.Cells(1, 1).EntireColumn.ColumnWidth     For Each cell In ws.UsedRange         cell.EntireColumn.ColumnWidth = max_width / aspect_ratio         cell.RowHeight = max_width     Next cell End Sub

Insert the intended code to make Same Height and Width Cells for Used Range

Step 3:

This is the output

Output of running VBA to make same height and width cells for Used Range

Read More: How to Use AutoFit Shortcut in Excel


How to Change Back to Default Cells Height and Width

You can revert cells height and width to default values.

Initial Excel Sheet to Change Back to Default Cells Height and Width

Set all columns in the worksheet to default width, 8.43. 

Step 1:

  • Click Select All >> Go to the Home tab>> Click Format in Cells.

Click on Select All button, go to Home and expand Format drop down

Step 2:

  • Click Column Width => Enter 8.43.

In the Column Width dialog box, input 8.43 in the Column Width field

Step 3:

  • Click OK to see the result.

All the cell widths become equal to 8.43

Set all rows to the same height,15.

Step 4:

  • Go to Format and select Row Height.

Again expand the Format drop down and choose Row Height

Step 5:

  • Click Row Height >> Enter 15.

In the Row Height dialog box, input 15 in the Row Height field

Step 5:

  • Click OK to change back to the default values.

Changing Back to Default Cells Height and Width


Download Practice Workbook

Download the workbook here.


 

Related Articles


<< Go Back to Cell Size | Excel Cells | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!

Leave a Reply

Your email address will not be published. Required fields are marked *

Advanced Excel Exercises with Solutions PDF