To make a single cell square, set it to the desired width and then use
cell.RowHeight = cell.Width
Be sure not to use .Height
or .ColumnWidth
- why?
.Height
(and .Width
) seem to be read-only.
.ColumnWidth
is measured in the weird units everyone is talking about here.
I manually squared a cell in Excel (to a size of 20.71 "something", and 150 "pixels") and looked at its properties in VBA:
So, you see how every single answer manipulating .ColumnWidth
must be very complicated - and in my case, a solution that worked at 100% (Windows 10) zoom level failed at 125% zoom level. There is a host of questions related to settings columns to the desired width (in pixels or whatever unit), but this actually not what this question is about. Again, set width (manually or however), then set height from width.
This answer is inspired by @AmitPanasara's answer, be sure to upvote his as well if you like this one.