PDA

View Full Version : Temporarily widen column



Phelony
04-06-2009, 01:54 AM
Morning...I'd be extremely grateful if someone could help me figure out what's wrong with the below. :help

It's supposed to expand column C when row 12 is selected and then change it back when it's deselected. This is to expand the column to allow a drop down list to widen temporarily. :banghead:



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Row = 12 Then
Target.Columns(3).ColumnWidth = 20
Else
Columns(3).ColumnWidth = 5
End If
End Sub

Any and all assistance is warmly welcomed! :yes

Phel

Bob Phillips
04-06-2009, 02:18 AM
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Me.Columns(3).ColumnWidth = IIf(Target.Row = 12, 20, 5)
End Sub

Phelony
04-06-2009, 02:21 AM
:thumb

Superstar, thank you so much!

:beerchug: