I would like to use code in an If statement to perform an action on a specific date each year if the workbook is open on that date.
I would use the systemdate but cannot figure out a way to have the code run each year. Is there a wildcard I could place in the year to allow it to run each year ?
Also, is there a way to code it so the code would run between two dates each year ? For example, between Jan 30 and Feb 5 each year ?
[VBA]
Sub DateCheck()
Dim currentdate As Date
currentdate = Date
If currentdate > "1/30/2010" Then
MsgBox "This is where code goes"
Exit Sub
Else
' Do Nothing - runs without code being activated
End If
End Sub
[/VBA]
thanks in advance!