Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Private Sub Workbook_Open() doesn't run Steve Starr Excel Discussion (Misc queries) 4 April 3rd 11 05:05 AM
Workbook_Open code help Colin Hayes Excel Discussion (Misc queries) 1 April 5th 10 02:13 AM
Workbook_Open() Event Bill Martin Excel Discussion (Misc queries) 9 January 13th 06 08:24 PM
Workbook_Open () Bill Martin Excel Discussion (Misc queries) 12 December 20th 05 05:37 PM
Workbook_Open not working Sheena N via OfficeKB.com Excel Discussion (Misc queries) 4 May 6th 05 01:31 AM


All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"