Afro_Cookie
Board Regular
- Joined
- Mar 17, 2020
- Messages
- 103
- Office Version
- 365
- Platform
- Windows
found a post, Application.ontime DateValue ???, that showed how to set a specif day of the week for an application.OnTime to run, but cannot get it to work for my file.
I want my macro to run every Friday @ 9:00AM but nothing happened when I changed the values to today in order to test. Can someone please help me out.
I want my macro to run every Friday @ 9:00AM but nothing happened when I changed the values to today in order to test. Can someone please help me out.
VBA Code:
Sub Auto_Send()
Dim NextFridayDate As Date
NextFridayDate = Date - Weekday(Date) + vbWednesday - 7 * (vbWednesday <= Weekday(Date))
Application.OnTime NextFridayDate + TimeValue("13:08:00"), "MyMacro"
End Sub