Maybe this.....
Sub YourMacroName()
'Variable declaration required for your code
If TimeValue(Now) < TimeValue("10:00:00") And TimeValue(Now) > TimeValue("00:00:00") Then
If Day(Date) < 15 And Day(Date) > 20 Then
'your code here
MsgBox "You can run the code." 'Example code
Else
MsgBox "You can only run this code before 15th and after 20th of any month.", vbCritical, "Code Execution Not Allowed!"
End If
Else
MsgBox "You can only run this code between 12:00:01 AM To 09:59:59 AM.", vbCritical, "Code Execution Not Allowed!"
End If
End Sub
Bookmarks