VBA dates from one sheet to next

SarahNoob

New Member
Joined
Feb 24, 2025
Messages
1
Office Version
  1. 365
Hello

I have sheet1 with a range of dates. These dates are either today or a period before today.

I am trying (unsuccessfully) to print these dates into sheet2.

I need to offset any date that is today by 1 day but if the date is before today leave it as is.

Thank you for your time.

S
 
Hi there SarahNoob,

You can reference a cell from another sheet by appending the sheet name in front of the cell reference and adding an ! (example: =Sheet1!D4)
To check if a date is today, you can use the TODAY() function in an IF statement.
To offset a date, you can reference the cell with the date and simply add/subtract 1.
You'll need to make sure the cell is formatted as a date, or you may get some undesired results.
To format a cell as a date, navigate to Home --> Number and select Short Date from the drop down box.

Proving Grounds.xlsx
AB
1DateOffset date
23/15/20253/15/2025
33/16/20253/16/2025
43/17/20253/17/2025
53/18/20253/18/2025
63/19/20253/20/2025
Date Offset
Cell Formulas
RangeFormula
B2:B6B2=IF(A2=TODAY(), A2+1, A2)


Hope this helps :D
 
Upvote 0

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