July 22

Completing the Square aka The "Most" Squares Method

0  comments

Now that I actually have some traffic to this blog, it’s probably time I started adding posts.

A while ago, I was wondering how to make the cells in Excel exactly square, like the squares on graph paper.  I came across this post from Mr. Excel.  I wasn’t in love with his solution because it requires users to first find their desired width by dragging a column, then writing it down (keep in mind it’s in pixels, so you might not have an easy round number), and then entering it into an input box.

So, without further ado, I present my solution that doesn’t require you to write anything down:

Private Sub AutoSize()

    Dim cels As Range
    Set cels = Me.Cells
 
    cels.ColumnWidth = 1  'Adjust me
    cels.RowHeight = cels(1, 1).width
 
    Set cels = Nothing

End Sub

To get different sized squares, simply adjust your ColumnWidth.  For further reading, checkout why widths in Excel are so tricky.

Jordan Goldmeier
Latest posts by Jordan Goldmeier (see all)

Tags


You may also like

April 9, 2011

How to Create a Rollover Effect in Excel: Execute a Macro When Your Mouse is over a Cell

October 26, 2014

Monte Carlo Simulation Formula in Excel – Tutorial and Download

September 17, 2012

The Excel Rollover Mini FAQ
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Free 24 Excel Tips Guide

Discover the secrets to Excel efficiency with our free guide: '24 Proven Microsoft Excel Tips to Help You Save Time'

A humble gift from us to you, to make your Excel journey smoother and more productive. Grab your copy now and start mastering Excel like never before!

>