how do i set up an expiry date in an Excel worksheet

G

Guest

I would like to know if there is a way to set up an expiry date in an excel
worksheet that lets you know when it is approaching a specific date.
Currently using Excel 2002
 
J

JE McGimpsey

You could put this in the ThisWorkbook code module:

Private Sub Workbook_Open()
Const dtEXPIRED As Date = #6/5/2005#
Select Case dtEXPIRED - Date
Case Is < 0
MsgBox "This workbook has expired."
Case 0
MsgBox "This workbook expires today."
Case Is < 30
MsgBox "This workbook expires in " & _
dtEXPIRED - Date & " days."
Case Else
'do nothing
End Select
End Sub

This doesn't actually cause any changes in the workbook, however.

If you're unfamiliar with macros, see

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
A

Andy Wiggins

Here's a formula that lets you know when a specific date is approaching:

=IF((NOW()+5)<DATE(2005,6,14),"OK","Approaching a critical date")

When you get to within the critical time period, the value in the cell
changes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top