Hi,
I want to add an automatic static week ending date for the previous week into a payroll template. Workers are paid for the previous week worked, they can work Monday to Sunday so I need the VBA to add the previous week ending date (which should be Sunday). Any time the grand total cells (H46, I46, O82,O113) have a figure greater than 0 I want the date cell to show the previous week ending date.
So if I do the payroll on Tuesday the date shown would be the previous Sunday.
I've tried this formula =IF(WEEKDAY(TODAY(),2)=7,TODAY(),TODAY()-WEEKDAY(TODAY(),2)) but it only gives me a volatile previous week ending date which means it's not static and it's not triggered by input into the the grand total cell so it comes up whenever the template opens.
any help with this problem would be greatly appreciated. Thanks
I want to add an automatic static week ending date for the previous week into a payroll template. Workers are paid for the previous week worked, they can work Monday to Sunday so I need the VBA to add the previous week ending date (which should be Sunday). Any time the grand total cells (H46, I46, O82,O113) have a figure greater than 0 I want the date cell to show the previous week ending date.
So if I do the payroll on Tuesday the date shown would be the previous Sunday.
I've tried this formula =IF(WEEKDAY(TODAY(),2)=7,TODAY(),TODAY()-WEEKDAY(TODAY(),2)) but it only gives me a volatile previous week ending date which means it's not static and it's not triggered by input into the the grand total cell so it comes up whenever the template opens.
any help with this problem would be greatly appreciated. Thanks
Last edited: