How to square multiple cells in Excel?

Sometimes, you need to make cells square in a worksheet, so that you can draw some flowchart or house plans. But the cell row height and column width have different units, so it is difficult for you to set both row height and column width in the same dimension. Here are some tricks for you to solve this problem:

Square multiple cells by dragging column and row borders

Square multiple cells with VBA code

Square multiple cells with Kutools for Excel

Recommended Productivity Software

Office Tab: Use tabbed interface in Office as the use of web browser Chrome, Firefox and Internet Explorer.
Kutools for Excel: Adds 120 powerful new features to Excel. Increase your productivity in 5 minutes. Save two hours every day!
Classic Menu for Office: Brings back your familiar menus to Office 2007, 2010 and 2013 (includes Office 365).

arrow blue right bubble Square multiple cells by dragging column and row borders

Hint


If you want to make the each cells 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 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 (100pixels)".

doc-square-cells1

3. Then put the cursor to the border between row 1 and row 2. While the cursor change to black double arrow, drag it, make the number in pixel match with the pixel number you got in step 2, you will get "Height 75.00(100pixels)".

doc-square-cells2

When you release the mouse, you will have whole sheet of square cells with 100 * 100 pixels. See screenshot:

doc-square-cells3


arrow blue right bubble 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, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following code into the Module:

Sub MakeSquare()
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 doc-multiply-calculation-3button to run the code. And a prompt box will pop out to remind you enter the number you need. See screenshot:

doc-square-cells4

4. Then click OK. And the selected cells have been changed to square cells.

Note: In the above code, you can only enter the number between 0 and 2.5 inches, if the entered number equal 0 or less than 0 or the number equal 2.5 or greater than 2.5, this code will not available.


arrow blue right bubble Square multiple cells with Kutools for Excel

The above code has some limitation, and it only use the inch as the unit. If you want to create a square as 5*5 cm in excel, how could you do?

Kutools for Excel: with more than 120 handy Excel add-ins, free to try with no limitation in 30 days. Get it Now

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:

doc-square-cells5

3. In the Adjust Cell Size dialog box, specify the unite type. And then enter the row height and column width as the same number as you need. See screenshot:

doc-square-cells6

4. Click OK or Apply, the selected cells have been changed to squares with 2 * 2 cm.

doc-square-cells7

Note: You can set other unit such as Pound, Inches or Pixels as you want.

Click to know more about this Adjust Cell Size feature.


Related articles:


Is your problem solved?

Recommended Productivity Tools

The following tools will greatly save your time and effort, which one do you prefer?
Office Tab: Using handy tabs in your Office, as the way of Chrome, Firefox and New Internet Explorer.
Kutools for Excel: 120 powerful new functions for Excel, Increase your productivity in 5 minutes. Save two hours every day!
Classic Menu for Office: Bring back familiar menus to Office 2007, 2010, 2013 and 365, as if it were Office 2000 and 2003.

Kutools for Excel

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

gold star1 More than 120 powerful advanced functions which designed for Excel:

  • 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,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

btn read more     btn download     btn purchase