ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date change button/macro (https://www.excelbanter.com/excel-programming/374039-date-change-button-macro.html)

Kamran

Date change button/macro
 
Hello,
I use a spreadhseet as a timesheet for work, and every week I have to change
the dates. I use the date in the first cell (for Monday) and the others just
calculate "+1". What kind of a macro can I assign to a button that I can
just click to add 7 to the Monday date?
Thanks,
Kamran

Charles Chickering

Date change button/macro
 
Kamran, Try using the following Worksheet function:
=IF(WEEKDAY(TODAY())=2,TODAY(),IF(WEEKDAY(TODAY()) <2,TODAY()+1,TODAY()-WEEKDAY(TODAY())+2))
It should update everytime you open excel
--
Charles Chickering

"A good example is twice the value of good advice."


"Kamran" wrote:

Hello,
I use a spreadhseet as a timesheet for work, and every week I have to change
the dates. I use the date in the first cell (for Monday) and the others just
calculate "+1". What kind of a macro can I assign to a button that I can
just click to add 7 to the Monday date?
Thanks,
Kamran


Kamran

Date change button/macro
 
Hi Charles,
Thanks for the formula; never seen anything like that, can you please
describe what it's calculating? I'm not sure I'm going to be able to use it,
let me explain. I keep an Excel document, where for each week I add a new
tab for my timesheet for that week. All I want to do is update the one cell
where Monday's date is. So I don't want it to update automatically, because
the old time sheets need to remain static. I want a macro that I can assign
to a toolbar button that will just add 7 to that Monday date. All other
dates are already calculated based on the Monday, so I don't need to worry
about them.
Thanks,
Kamran.


All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com