Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I got the the following code from contextures.com, but it's not satisfying. Is there a way to change it so that it will work on a given range of cells with dropdown list so that any cell in the range, say "A1:Z1" will temporarily widen when selected?
Here's the code they gave: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Column = 4 Then Target.Columns.ColumnWidth = 20 Else Columns(4).ColumnWidth = 5 End If End Sub --- Thanks |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column 26 Then Exit Sub If Not Application.Intersect(Range("a1:z1"), _ Target) Is Nothing Then Target.Columns.ColumnWidth = 20 Else Target.Columns.ColumnWidth = 5 End If End Sub Gord Dibben MS Excel MVP On Mon, 26 Jun 2006 17:50:40 +0100, XXL User wrote: I got the the following code from contextures.com, but it's not satisfying. Is there a way to change it so that it will work on a given range of cells with dropdown list so that any cell in the range, say "A1:Z1" will temporarily widen when selected? Here's the code they gave: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Column = 4 Then Target.Columns.ColumnWidth = 20 Else Columns(4).ColumnWidth = 5 End If End Sub --- Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dropdown list key selection | Excel Discussion (Misc queries) | |||
Change case...help please | Excel Worksheet Functions | |||
How do I change the width of the data validation list box? | Excel Discussion (Misc queries) | |||
Macro for changing text to Proper Case | Excel Worksheet Functions | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions |