adding or subtracting 1 to date field on button click

splreece

Board Regular
Joined
May 29, 2015
Messages
72
morning all,

ive googled and found lots of scripts on user specified dates but nothing on simply adding or subtracting 1 via a button click.


does anyone have recommendations on scripts or where to look.

it is important that I can cycle by day, so the user will also start on today, but I want 2 buttons, a +1 button and -1 button (therefore easily cycle through various days).

any thoughts?


PS the date field that governs all the formulae is in "H2".

All the calulations on the page link to a dataset and use H2 as the 'ifs' date identifier.
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Assign the button to this:

You can select any cell and change it by the button. If you specifically want to change H2, replace "ActiveCell" with "Range("H2")" in both places

Code:
Sub minusOne()
ActiveCell = ActiveCell - 1
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,378
Messages
6,119,188
Members
448,873
Latest member
jacksonashleigh99

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top