Autofit Columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know when dates are entered into cells the column automatically autofits.
Is there any way to do that with text. Instead of clicking on
column/format/autofit?
Thanks.
 
You could use an event macro that autofits the changed cell's columns whenever
you make a change.

If you want to try, rightclick on the worksheet tab that should have this
behavior. Select view code and paste this into the code window:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Target.EntireColumn.AutoFit
End Sub

But be aware that most macros destroy the Edit|Undo and Edit|Redo stack. (I'd
just do it manually so I wouldn't lose that.)
 
A simpler way to make a column autofit is to hover over the right hand edge
of the column label. When the cursor changes to the double arrow, then double
click.
 
Back
Top