GoldenFireTiger
MIS
I want to run a macro which in turn runs a macro every saturday. I have the following as a module. it finds the nearest saturday. Would it be possible to amend this code to include a few lines to run the macro only if today is saturday?
Function GetSatDate(CurrentDate)
If VarType(CurrentDate) <> 7 Then
GetSatDate = Null
Else
Select Case Weekday(CurrentDate)
Case 1 ' Sunday
GetSatDate = CurrentDate - 1
Case 2 ' Saturday
GetSatDate = CurrentDate
Case 3 To 7 ' Monday..Friday
GetSatDate = CurrentDate - Weekday(CurrentDate) + 2
End Select
End If
End Function
Function GetSatDate(CurrentDate)
If VarType(CurrentDate) <> 7 Then
GetSatDate = Null
Else
Select Case Weekday(CurrentDate)
Case 1 ' Sunday
GetSatDate = CurrentDate - 1
Case 2 ' Saturday
GetSatDate = CurrentDate
Case 3 To 7 ' Monday..Friday
GetSatDate = CurrentDate - Weekday(CurrentDate) + 2
End Select
End If
End Function