Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Worksheet Expiration

Hi,
I want to set an expiration date for a worksheet. I'll store the date in an
xlveryhidden sheet in a cell.

Can someone help with the code to check the cell and compare to now, and
goto a sub to hide the other sheets?

Thanks,

Brian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet Expiration


Hello Brian,

This macro should get you going. Just change the Worksheet name to
match the name of your "Very hiddden Worksheet" and cell "A1" to cell
that will hold your expiration date. Set the variable "UsableDays" to
the number of days that can pass before the worksheet expires.

'<Start Macro Code
Sub CheckExpiration()

Dim DaysElapsed
Dim ExpirationDate
Dim HiddenSheet As Worksheet
Dim UsableDays
Dim Wks

UsableDays = 30
Set HiddenSheet = Worksheets("Sheet3")
ExpirationDate = HiddenSheet.Range("A1").Value

DaysElapsed = Int(Now) - Int(ExpirationDate)

If DaysElapsed = UsableDays Then
For Each Wks In Worksheets
If Wks.Name < HiddenSheet.Name Then
Wks.Visible = False
End If
Next Wks
End If

End Sub
'<End Macro Code

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=503490

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
Expiration dates Deeno Excel Worksheet Functions 7 July 9th 09 01:42 AM
Calculat an expiration date old coach Excel Worksheet Functions 0 February 23rd 09 03:55 AM
Macro Expiration Code Teddy-B Excel Discussion (Misc queries) 3 October 20th 08 05:15 PM
Expiration Formula Dimitri Excel Discussion (Misc queries) 2 March 6th 08 08:37 PM
Code For Expiration Date Juan[_3_] Excel Programming 2 October 25th 03 09:15 AM


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

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

About Us

"It's about Microsoft Excel"