Autofit Columns

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

Dave Peterson

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

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top