Date in VBA for Last Monday to sunday

papasmurfuo9

Registered User.
Local time
Today, 15:19
Joined
May 28, 2014
Messages
69
Hi

could someone advise on how to set parameters for the date being last monday to last sunday


so

Paramaters = Date

then i need

ParamatersWeek = the last monday to the last sunday

thank you!
 
date-weekday(date)-5
Yields 20 jul, i.e. your monday, I am sure you can figure the sunday from there.
 
with date() being today (31st July)

between dateadd("d",-weekday(date(),vbmonday)-6,date()) AND dateadd("d",-weekday(date(),vbmonday), date())

will give you between 20th July and 26th July
 

Users who are viewing this thread

Back
Top Bottom