Hello All,
So I am trying to run 3 different macros based on the day of the week. The code I found worked when I just used one day but when I entered the same code in for all 5 days, I keep getting the error: Block If without End If.
Here is the code I have so far:
Sub Datetest()
Dim sDate As String
sDate = Format(Date, "ddd")
If sDate = "Mon" Then
Run "Monday"
Else
If sDate = "Tue" Then
Run "Tuesday"
Else
If sDate = "Wed" Then
Run "Macro1"
Else
If sDate = "Thu" Then
Run "Macro1"
Else
If sDate = "Fri" Then
Run "Macro1"
End If
End If
End Sub
Any help would be much appreciated.
Thanks!
So I am trying to run 3 different macros based on the day of the week. The code I found worked when I just used one day but when I entered the same code in for all 5 days, I keep getting the error: Block If without End If.
Here is the code I have so far:
Sub Datetest()
Dim sDate As String
sDate = Format(Date, "ddd")
If sDate = "Mon" Then
Run "Monday"
Else
If sDate = "Tue" Then
Run "Tuesday"
Else
If sDate = "Wed" Then
Run "Macro1"
Else
If sDate = "Thu" Then
Run "Macro1"
Else
If sDate = "Fri" Then
Run "Macro1"
End If
End If
End Sub
Any help would be much appreciated.
Thanks!