How to square multiple cells in Excel?
Occasionally, you might need square-shaped cells in a worksheet to create flowcharts or house plans effectively. However, adjusting cells to be square can be challenging because row heights and column widths are measured in different units. This article will provide you with practical tips on how to evenly adjust both dimensions, making it easier to achieve square cells in your Excel spreadsheet.
Square multiple cells by dragging column and row borders
Square multiple cells with Kutools for Excel
Square multiple cells with VBA code
Square multiple cells by dragging column and row borders
If you want to make each cell of a worksheet an exact square, please do as follows:
1. Press Ctrl + A to highlight the whole worksheet.
2. Put the cursor to the border between column A and column B, the cursor will change to a black double arrow, drag it, and you will see two numbers like "Width: 8.43 (64pixels)", drag up to a number you need. In this example, I will drag up to "Width: 13.57 (100 pixels)".
3. Then put the cursor on the border between row 1 and row 2. While the cursor changes to a black double arrow, drag it, and make the number in pixel match with the pixel number you got in step 2, you will get "Height 75.00(100 pixels)".
When you release the mouse, you will have a whole sheet of square cells with 100 * 100 pixels. See screenshot:
Square multiple cells with Kutools for Excel
The above code has some limitations, and it only uses the inch as the unit. If you want to create a square as 5*5 cm in Excel, how could you do it?
If you have installed Kutools for Excel, this problem will be easily solved.
1. Highlight the cells you want to make them square。
2. Click Kutools > Range Converter > Adjust Cell Size, see screenshot:
3. In the Adjust Cell Size dialog box, specify the unit type. And then enter the row height and column width as the same number as you need. See screenshot:
4. Click OK or Apply, the selected cells have been changed to squares with 2 * 2 cm.
- You can set another unit such as Pound, Inches, or Pixels as you want. Click to learn more about this Adjust Cell Size feature.
- Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Get Kutools for Excel Now!
Square multiple cells with VBA code
The following VBA code also can help you to solve this task.
1. Select the cells that you want to make them square.
2. Click Developer > Visual Basic and a new Microsoft Visual Basic for Applications window will be displayed, click Insert > Module, and input the following code into the Module:
Sub MakeSquare()
'Updated by Extendoffice 2024/07/15
Dim WPChar As Double
Dim DInch As Double
Dim Temp As String
Temp = InputBox("Height and width in inches?")
DInch = Val(Temp)
If DInch > 0 And DInch < 2.5 Then
For Each c In ActiveWindow.RangeSelection.Columns
WPChar = c.Width / c.ColumnWidth
c.ColumnWidth = ((DInch * 72) / WPChar)
Next c
For Each r In ActiveWindow.RangeSelection.Rows
r.RowHeight = (DInch * 72)
Next r
End If
End Sub
3. Then click the button to run the code. A prompt box will pop out to remind you to enter the number you need. See screenshot:
4. Then click OK. And the selected cells have been changed to square cells.
Related articles:
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
![Screen Shot of Excel (with Office Tab installed)](http://cdn.extendoffice.com/images/stories/kte-module/officetab-bottom-02.gif)