Function TestIfWeekend(startDate, endDate)
Dim varDate
TestIfWeekend = "XXX"
If startDate = 0 Then Exit Function
If endDate = 0 Then Exit Function
If endDate - startDate < 2 Then Exit Function
For varDate = startDate To endDate - 1
If WeekDay(varDate) = 7 Then
TestIfWeekend = "OK": Exit Function
End If
Next varDate
End Function
|