Thread: Column Width
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Column Width

Is this what you are looking for? Right-click the tab at the bottom of the
sheet where you want this functionality to occur, select View Code from the
popup menu that appears and copy/paste the following into the code window
that opened up...

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

Change the 7 to the column number of the column you want this functionality
for. Go back to the worksheet and enter some values into the column you
specified.

--
Rick (MVP - Excel)


"hshayhorn" wrote in message
...
Is there a way to have the column width auto adjust to the width of the
text
that is entered? For example if I start with a width of 20 and after data
is
entered into the cell if the cell is to small have the cell adjust it's
width
without the user having to do anything?