Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I create multiple column width in the same column in excel | Excel Discussion (Misc queries) | |||
How to make cell width different than the column width it lies in | Excel Discussion (Misc queries) | |||
column width | Excel Discussion (Misc queries) | |||
Varying column width in a column chart | Charts and Charting in Excel | |||
Change the width of a single column in a column chart | Charts and Charting in Excel |