stathis1234
New Member
- Joined
- Jun 29, 2018
- Messages
- 7
I have an excel sheet that 6 columns have data validation, (drop down list), i want the width of the drop down list to expand when is selected
the following VBa code worked for me but is only for one column is there any way to do it for 6 columns
the VBA code is the following
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 1 Then
Target.Columns.ColumnWidth = 30
Else
Columns(1).ColumnWidth = 5
End If
End Sub
the following VBa code worked for me but is only for one column is there any way to do it for 6 columns
the VBA code is the following
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 1 Then
Target.Columns.ColumnWidth = 30
Else
Columns(1).ColumnWidth = 5
End If
End Sub