How do I change the value in cell based on a future date

  • Thread starter Thread starter Guest
  • Start date Start date
one way:

Put this in the ThisWorkbook code module (Right-click the workbook title
bar and choose View Code):

Public Sub Workbook_Open()
If Date > #12/15/2004# Then _
Sheets("Sheet1").Range("A1,B2,J10,K39").ClearContents
End Sub

Note that this won't work if the user opens your workbook with macros
disabled.

Note also that there's no way to prevent a user from accessing your data
- i.e., they can set their clock back and open the file. You can make
things more difficult, but not much...
 
And just to add to JE's post...

If the user allows this macro to run, then those cells will be cleared each time
the workbook opens.
 

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

Back
Top