# How to Make Excel Cells the Same Height and Width (3 Easy Ways)

Get FREE Advanced Excel Exercises with Solutions!

In this Excel tutorial, you will learn how to make cells with the same height and width. Excel cells can be made of the same height and width by several methods, like by making the cells with the same height and width in pixels, taking the worksheet in the Page Layout view and using the scale, or using Excel VBA.

Note: While writing this article, I have used Microsoft Excel 365. But these methods can be used with any Excel version.

Suppose you want to create an attendance sheet in Excel for students, employees, trainees, or any group. It would be easy to spot if the cells where you input attendance in a sheet are square-shaped. Equal cell sizes ensure that each entry has essential information to be noticed.

## Why Make Excel Cells with Equal Height and Width?

Making cells the same height and width in Excel means ensuring that the row height and column width are equal. That will result in a perfectly square cell. Square cells can improve the formatting, alignment, and design of worksheet cells. These cells are needed for making attendance sheets, tables, or calendars.

## 1. Making Excel Cells Equal by Pixels to Get the Same Height and Width

Making square cells can be quickly done by making the cell heights and widths equal by pixels. If you want to make cell heights and widths equal for the Entire Worksheet, making Excel cells equal by pixels is convenient.

For example, I have a worksheet like the following image. I am going to make all the cells within the sheet equal in height and width.

Click on the image for better quality

First, we shall make all the columns of the worksheet have the same width.Â

Step 1: Click the Select All button => Go to the Home tab => From the Cells group, click on the Format drop-down => You can see a list of commands, including Column Width.

Step 2: Click on the Column Width command => the Column Width dialog box will appear => Insert the desired value in the Column Width field.

Step 3: Now, click OK in the Column Width dialog box => You will get the output like the following image. The width of all the columns is now the same width of 10.

Click on the image for better quality

Now, we shall make all rows with the same height.Â

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

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 => We will see the cells within the sheet with the same height and width.

Note

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

## 2. Taking the Worksheet to Page Layout view and using the Scale Feature to Make Cells Same Height and Width

Page Layout View lets us see the print layout of a sheet before printing. So, making cells with the same height and width using Page Layout View has an extra benefit. We can check the print layout when printing the sheet containing square cells.

In this method, we shall use Excelâ€™s Page Layout feature to make cells of the same height and width. Suppose we have the same worksheet as the image below.

Step 1: Click on the Select All button => Navigate to the View tab => In the Workbook Views group, you see the Page Layout command.

Note

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

Step 2: After clicking Page Layout, you will see measuring scales above the columns and on the left side of the rows.

Click on the image for better quality

Step 3: Now, go to Home => click on the Format drop-down in the Cells group => You will see the Column Width command.

Click on the image for better quality

Step 4: Click on the Column Width command =>You will see the Column Width dialog box => Input 1 in the Column Width field.

Step 5: After clicking OK in the Column Width dialog box, all cell widths become 1 inch.

Step 6: Click on the Format drop-down => You will find the Row Height command.

Step 7: Click the Row Height command => the Row Height dialog box will appear => Insert 1 in the Row Height field.

Step 8: Finally, click OK in the Row Height dialog box to see an output like the following.

Read More: How to AutoFit in Excel

## 3. Using Excel VBA Code to Make Cells with Equal Height and Width

You can quickly achieve your goal by running Excel VBA Code only by clicking. We present three Excel VBA procedures to make square cells for Entire Worksheet, Selected Cells, and Used Range.

### 3.1 Same Height and Width Cells for Entire Worksheet

Letâ€™s consider a sheet shown in the following screenshot. Throughout this section, we will use VBA to make the same height and width cells for the Entire Worksheet.

Step 1: Navigate to the Developer tab => You will find the Visual Basic command under the Code group.

Step 2: Click on Visual Basic to open the VBA Editor window => Hover over Insert and click on Module => Paste the following code in the module => Run.

``````Sub MakeCellsEqualHeightWidth()
Â Â Â
Â Â Â  With Cells(1, 1)
Â Â Â Â Â Â Â  Cells.RowHeight = .Width
Â Â Â Â Â Â Â  Cells.ColumnWidth = .ColumnWidth
Â Â Â  End With

End Sub``````

Note

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

Step 3: Return to the sheet and see that we have created squared cells within the Entire Worksheet.

### 3.2 Same Height and Width for Selected Cells

Using VBA, we can easily make the selected cells the same height and width. Here, letâ€™s consider the selected range A4:D7, like the image below.

Step 1: Select the A4:D7 range => Go to the Developer tab => You will find the Visual Basic command in the Code group.

Step 2: Click on Visual Basic => You will see the VBA Editor window >> Hover over Insert >> click on Module => Next, paste 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``````

Step 3: Now, go back to the sheet and see we have made the Selected Cells square like the following image.

Note

All the cellsâ€™ column widths in the sheet were the same by default before running the VBA code. Thatâ€™s why you may think the code is working for the selected cellsâ€™ rows. But technically, the code is working only for the selected cells.

### 3.3 Same Height and Width for Used Range Cells

Excel defines the used range dynamically based on the cells that contain data, formulas, or formatting.

Letâ€™s consider a Used Range throughout range A4:D7, as shown in the image below. We will make the same height and width for Used Range cells using VBA.

Step 1: Go to Developer >> Under the Code group, you see the Visual Basic command.

Step 2: Click on Visual Basic => You will see the VBA Editor window >> Expand Insert >> click on Module >> Later, paste the following code in 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``````

Step 3: Thus, we have created the Used Range cells with the same height and width.

Read More: How to Use AutoFit Shortcut in Excel

## How to Change Back to Default Cells Height and Width

You can revert to the default cell heights and widths when you no longer require custom cell sizes.

Suppose we have cells within a sheet with multiple heights and widths. We want to change the cell height and width for the Entire Worksheet back to the default.

Firstly, we will make all the columns of the worksheet the default width, which is 8.43.Â

Step 1: First, click on the Select All button >> Go to Home >> Click the Format drop-down under the Cells group >> You can see the Column Width command.

Step 2: Click the Column Width command => You will see the Column Width dialog box =>Â  Insert 8.43 in the Column Width field.

Step 3: After clicking OK in the Column Width dialog box, all the cell widths become equal.

Now, we are going to make all rows with the same height, which is 15.

Step 4: Again, expand the Format drop-down >> You will see the Row Height command.

Step 5: Click on the Row Height command => The Row Height dialog box will appear >> Input 15 in the Row Height field.

Step 5: Finally, click OK in the Row Height dialog box to change back to the default cell height and width.

I have practiced the first two methods within the .xlsx file. While using VBA, I worked in the .xlsm file.

## Conclusion

So, in this Excel tutorial, I have shown you several methods to make the Excel cells the same height and width, for example, making the height and width of the cells Pixel equal, then taking the worksheet to the Page Layout view and using the Scale provided by this view, then I have shown several VBA code to make the cells same height and width at one single click. Do not hesitate to leave a comment if you have any questions.

## What is ExcelDemy?

ExcelDemy Learn Excel & Excel Solutions Center provides free Excel tutorials, free support , online Excel training and Excel consultancy services for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Lutfor Rahman Shimanto

Lutfor Rahman Shimanto, BSc, Information Technology, Jahangirnagar University, Bangladesh, has been working with the ExcelDemy project for more than 1 year. He has written 50+ articles for ExcelDemy. Currently, he is working as an Excel & VBA Developer and also provides support and solutions in the ExcelDemy Forum. His work and learning interests are in developing various Excel applications. Outside of work, he enjoys Chess a lot. He is a founding Jahangirnagar University Chess Club member and an internationally rated chess player.

We will be happy to hear your thoughts

Advanced Excel Exercises with Solutions PDF