excel vba if sunday or saturday code example
Example 1: excel vba if sunday or staurday
MsgBox Weekday(my_date, vbMonday) > 5
' Or -------------------------------------------------------
Public Function IsWeekend(InputDate As Date) As Boolean
Select Case Weekday(InputDate)
Case vbSaturday, vbSunday
IsWeekend = True
Case Else
IsWeekend = False
End Select
End Function
Example 2: excel vba How to determine if a date falls on the weekend?
MsgBox Weekday(MyDate, vbMonday) > 5