PDA

View Full Version : Solved: Last weeks date



Keith58
08-17-2011, 03:54 AM
Hi,
I am very new to VBA - i need a messagebox that will will display last mondays date regardles of todays date i,e today is 17/8/2011 or 19/08/2011 but i need it to display 08/08/2011 this will also need to change for the following week i,e display 15/08/2011 if the date 23/08/11, this will then need to be confirmed and then put into cell B3.
Any help wil be grately appricated

Thanks
Keith

Bob Phillips
08-17-2011, 04:49 AM
Try



Range("B3").Value = Date - Weekday(Date, 2) + 1 - 7

Keith58
08-17-2011, 08:58 AM
Works perfect, thank you very much

Keith:yes