Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Column widths to adjust automatically?
How do I get column widths to automatically adjust depending on the size of
text entered in a cell ? |
#2
|
|||
|
|||
The only way to do it would be to use a change event macro.
With the workbook open press Alt+F11, this take you to the visual basic editor. In the left double click the worksheet where you want the code. Past the following code. Private Sub Worksheet_Change(ByVal Target As Range) Dim r As Range 'Set range, so we are looking for text entered in A1:A500, change this as needed. Set r = Intersect(Range("A1:A5"), Target) 'If the change in the worksheet is not detected, exit the macro. If r Is Nothing Then Exit Sub 'If text is entered do autofit on the column Columns("A:A").EntireColumn.AutoFit End Sub "lambola" wrote: How do I get column widths to automatically adjust depending on the size of text entered in a cell ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
what formula do i put for column m = column k minus column l in e. | Excel Discussion (Misc queries) | |||
Vary the column widths for different rows | Excel Discussion (Misc queries) | |||
How do I adjust column widths only on selected cells? | Excel Discussion (Misc queries) | |||
How do I fix column widths in Excel Pivot Tables? | Excel Discussion (Misc queries) | |||
How do I sort a column of formulas in Excel? | Excel Discussion (Misc queries) |