我正在尝试每天运行一个宏,但它应首先检查是否是工作日或周末。如果工作日运行代码,则退出sub。
以下是代码:
Dim checkday As Variant
checkday = Format(Date, "dddd")
If checkday <> "=Weekday" Then
MsgBox ("Selected date is a Weekend, Thus report cannot be generated!!!")
Exit Sub
End If
Rest of the code ...