Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
I changed the date on my computer to test the following code so the current date would be a date that falls on a Monday.
If the current day of the week is a Monday, display the current date in Sheet1.Range("B1")
The error message occurs on the following line of code the word "today" is highlighted in blue:
The rest of the code:
Thank You
If the current day of the week is a Monday, display the current date in Sheet1.Range("B1")
The error message occurs on the following line of code the word "today" is highlighted in blue:
Code:
Sheet1.Range("B1") = today()
The rest of the code:
Code:
Sub Weekdays()
If weekday(Now()) = vbMonday Then
MsgBox "Monday"
Sheet1.Range("B1") = today()
Else
MsgBox Format$(Now, "dddd")
Debug.Print Format$(Now, "dddd")
End If
End Sub