Square cells

The Idea Dude

Well-known Member
Joined
Aug 15, 2002
Messages
591
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,

Whats the ratio (width is to height) to get a perfect sqare cell.

So in other words, if I make a cell width 10, what height will I make the row to get a square cell ?

Thanks :biggrin:
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
THANKS for that :)

For anyone that looks at this thread, here is the code :)


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
 
Upvote 0
As an adjunct, here is some code to display the size of a cell:

Select the cell whose row height and column width you want to measure, and run one of the macros below. Code is placed in the Sheet module or in a General module. Many thanks to Andrew Poulsom, MrExcel message board.

'http://www.mrexcel.com/board2/viewtopic.php?t=53527

Code:
Sub CellSizeInMM()
    MsgBox "Row height is " & ActiveCell.EntireRow.Height / 72 * 25.4 & " mm"
    MsgBox "Column width is " & ActiveCell.EntireColumn.Width / 72 * 25.4 & " mm"
End Sub

Sub CellSizeInInches()
    MsgBox "Row height is " & ActiveCell.EntireRow.Height / 72 & " inches"
    MsgBox "Column width is " & ActiveCell.EntireColumn.Width / 72 & " inches"
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,228
Messages
6,123,747
Members
449,118
Latest member
kingjet

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top