View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_1137_] Rick Rothstein \(MVP - VB\)[_1137_] is offline
external usenet poster
 
Posts: 1
Default Excel column width

Here is a simpler event code procedure which will do the same thing...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then Target.Columns.AutoFit
End Sub

Rick


"Gary''s Student" wrote in message
...
A good question. Put this macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set clA = Range("A:A")
If Intersect(t, clA) Is Nothing Then Exit Sub
clA.Columns.AutoFit
End Sub

It is coded for column A. After any change in a column A cell, the column
width is automatically adjusted.
--
Gary''s Student - gsnu200800


"stan" wrote:

How can I make columns auto adjust the width to fit the data as I put it
in
without having to go to auto fit width after I enter the data?


--
stan