I would like to have last weeks Thursday date displayed in a msgbox... How can I do this?
Printable View
I would like to have last weeks Thursday date displayed in a msgbox... How can I do this?
VB Code:
Dim my_date As Date my_date = Date 'get into the end of "last week" my_date = DateAdd("d", -Weekday(my_date), my_date) 'count backwards to thursday Do While Weekday(my_date) <> vbThursday my_date = DateAdd("d", -1, my_date) Loop 'show date MsgBox Format(my_date, "ddd d m yy")