How do you specify what the "period declared" is? In the code? Here is an example that will allow the code to run only in November:
Public Sub Example()
Const AllowedMonth = 11
If Month(Date) <> AllowedMonth Then
MsgBox "You may only run this code in " & Format(DateSerial(Year(Date), AllowedMonth, 1), "Mmmm")
Exit Sub
End If
' the rest of your code goes here
End Sub
HOWEVER, the fact that you said that you have to update code for a new period suggests that you have a design problem. Your code should be written to be valid for whatever period your data indicates.
Bookmarks