Selection_Change

Mar 30, 2009

I'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

View 9 Replies


ADVERTISEMENT

How To Call Selection_Change Event

Mar 5, 2007

Is there a way to call a sheet selection change event when the workbook opens? I am currently using this work-around to call the event:

View 13 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved