Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook_Open() error
Hello,
The below code works great, but I have to access the code to modify the DateValue every now and again. I tried to create a Named Range (A1) called Expiration_Date, but I receive an error. What am I doing wrong? This gives me an error If Now = DateValue("Expiration_Date") Then This works, but I would like to call the date from cell A1 Private Sub Workbook_Open() ThisWorkbook.Unprotect Password:="1234" If Now = DateValue("11/01/2003") Then Worksheets("Oct").Visible = False Else Worksheets("Oct").Visible = True End If ThisWorkbook.Protect Password:="1234", _ Structu=True, Windows:=False End Sub Thanks Ruan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook_Open() error
Ruan,
Try If Now = DateValue(Range("Expiration_Date")) Then -- HTH Bob Phillips "Ruan" wrote in message ... Hello, The below code works great, but I have to access the code to modify the DateValue every now and again. I tried to create a Named Range (A1) called Expiration_Date, but I receive an error. What am I doing wrong? This gives me an error If Now = DateValue("Expiration_Date") Then This works, but I would like to call the date from cell A1 Private Sub Workbook_Open() ThisWorkbook.Unprotect Password:="1234" If Now = DateValue("11/01/2003") Then Worksheets("Oct").Visible = False Else Worksheets("Oct").Visible = True End If ThisWorkbook.Protect Password:="1234", _ Structu=True, Windows:=False End Sub Thanks Ruan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook_Open() error
Thanks Bob,
That works great. -----Original Message----- Ruan, Try If Now = DateValue(Range("Expiration_Date")) Then -- HTH Bob Phillips "Ruan" wrote in message ... Hello, The below code works great, but I have to access the code to modify the DateValue every now and again. I tried to create a Named Range (A1) called Expiration_Date, but I receive an error. What am I doing wrong? This gives me an error If Now = DateValue("Expiration_Date") Then This works, but I would like to call the date from cell A1 Private Sub Workbook_Open() ThisWorkbook.Unprotect Password:="1234" If Now = DateValue("11/01/2003") Then Worksheets("Oct").Visible = False Else Worksheets("Oct").Visible = True End If ThisWorkbook.Protect Password:="1234", _ Structu=True, Windows:=False End Sub Thanks Ruan . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Private Sub Workbook_Open() doesn't run | Excel Discussion (Misc queries) | |||
Workbook_Open code help | Excel Discussion (Misc queries) | |||
Workbook_Open() Event | Excel Discussion (Misc queries) | |||
Workbook_Open () | Excel Discussion (Misc queries) | |||
Workbook_Open not working | Excel Discussion (Misc queries) |