Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
I came up with this macro (from this NG) in my workbook. How can I change the password based on a date? Example: 8/20/07 = 1234 8/21/07 = 1235 8/22/07 = 1236 Etc. Thank you. Private Sub Workbook_BeforePrint(CANCEL As Boolean) If Date = Now() Then CANCEL = True Exit Sub End If PassWord = InputBox("Enter Password") If PassWord = "" Then CANCEL = True Exit Sub End If If PassWord = "1234" Then CANCEL = False 'CountPrinting 'Limit printing even with correct date & PW, still on the works Range("$A1").Select Else MsgBox " Try again ?", vb, "Wrong password !" CANCEL = True Exit Sub End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I change date based on year | Excel Worksheet Functions | |||
how to add a value based on a date change in Excel? | Excel Worksheet Functions | |||
change date based on time | Excel Discussion (Misc queries) | |||
How to see macro code of a password protected macro without a password? | Excel Worksheet Functions | |||
How do I change the value in cell based on a future date | Excel Discussion (Misc queries) |