P
PJ
All
Using formula to check date in a cell when opening workbook. Nb: A1 =
today()
if prior to 01/11/2006 ok no changes if equal to or after the 01/11/2006
then not ok and hide all sheets bar one called contact.
It only works if exact match i.e. if date on sheet is 01/11/2006
If Sheets("Menu").Range("A1") = "01/11/2006" Then hide sheets and reveal
contact The equal sign = being the key
When I try >= is grater than or equal to regardless of date (I.e.
31/10/2006 ) still hides sheets!!!
HELP!!!
Private Sub Workbook_Open()
If Sheets("Menu").Range("A1") >= "01/11/2006" Then
Sheets(Array("Health Dec", "Menu", "UK", "EU", "XU", "WW", "AT EU", "AT
WW", "Summary") _
).Select
Sheets("Health Dec").Activate
ActiveWindow.SelectedSheets.Visible = False
Sheets("Contact").Visible = True
Sheets("Long stay").Select
ActiveWindow.SelectedSheets.Visible = False
End If
End Sub
Using formula to check date in a cell when opening workbook. Nb: A1 =
today()
if prior to 01/11/2006 ok no changes if equal to or after the 01/11/2006
then not ok and hide all sheets bar one called contact.
It only works if exact match i.e. if date on sheet is 01/11/2006
If Sheets("Menu").Range("A1") = "01/11/2006" Then hide sheets and reveal
contact The equal sign = being the key
When I try >= is grater than or equal to regardless of date (I.e.
31/10/2006 ) still hides sheets!!!
HELP!!!
Private Sub Workbook_Open()
If Sheets("Menu").Range("A1") >= "01/11/2006" Then
Sheets(Array("Health Dec", "Menu", "UK", "EU", "XU", "WW", "AT EU", "AT
WW", "Summary") _
).Select
Sheets("Health Dec").Activate
ActiveWindow.SelectedSheets.Visible = False
Sheets("Contact").Visible = True
Sheets("Long stay").Select
ActiveWindow.SelectedSheets.Visible = False
End If
End Sub