Selection_Change
Mar 30, 2009I'm using this;
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("C3").Value = 28 Then
Columns("AK:AM").EntireColumn.Hidden = True
Else
If Range("C3").Value = 29 Then
Columns("AL:AM").EntireColumn.Hidden = True
Else
If Range("C3").Value = 30 Then
Columns("AM").EntireColumn.Hidden = True
Else
Columns("AK:AM").EntireColumn.Hidden = False
End If
End If
End If
End Sub
Feel free to improve it lol..............
Anyway, my question is this - cell C3 contains a number (28-31) and the code hides columns based on this value.
However C3 is a formula driven by a data validation cell in cell C2 - so if the user changes the value in C2, the columns will not hide until you click on C3