Skip to main content

How to square multiple cells in Excel?

Author: Xiaoyang Last Modified: 2024-07-25

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


arrow blue right bubble  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)".

doc-square-cells1

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)".

doc-square-cells2

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

doc-square-cells3


arrow blue right bubble  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?

Note:  To apply this Copy Full Path feature, firstly, you should download and install Kutools for Excel.

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 unit 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

Notes:

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 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  doc-multiply-calculation-3button to run the code. A prompt box will pop out to remind you to 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 is equal to 0 or less than 0 or the number is equal to 2.5 or greater than 2.5, this code will not be available.

Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

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...

Description


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!
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations