#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Column Width

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
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?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 114
Default Column Width

Rick--I think you saved my sanity! If we can take your instruction one step
further...I have approximately 80 columns (consecutively) that need this
adjustment. Is there a way to command this adjustment for all of those
columns at the same time, or do I have to repeat this process 80 times?
--
Hazel


"Rick Rothstein" wrote:

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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I create multiple column width in the same column in excel Vish Excel Discussion (Misc queries) 9 November 3rd 06 11:49 PM
How to make cell width different than the column width it lies in John Excel Discussion (Misc queries) 2 September 11th 06 10:41 PM
column width Jeanke Excel Discussion (Misc queries) 0 January 27th 06 07:38 PM
Varying column width in a column chart Silvie Dedkova Charts and Charting in Excel 1 March 22nd 05 01:53 PM
Change the width of a single column in a column chart Dave Charts and Charting in Excel 2 December 13th 04 07:25 PM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"