Automatically run macro on the 1st of each month (or the first time the doc is opened after the 1st of the month)

momentumons

Board Regular
Joined
Mar 30, 2020
Messages
57
Office Version
  1. 2016
Platform
  1. Windows
Hello! I have a sheet with a live forecast. I'd like to simply copy & paste the whole sheet into a 'prior forecast' tab in the same doc. (Paste as values). I'd like this to happen on the first of every month - this will then be used to compare the current fcst to the previous one.. As it's not just me using this document I really want it to happen automatically so that people don't forget the process. Is there a way I can write a macro that will run on a specific date? Or a better way?

My live forecast tab is called "FORECAST" and I don't yet have a "PRIOR FORECAST" tab but that could be called anything!

The data range to be copied & pasted as values is A:Z.

Thanks :)
 
You can set up a procedure to run when the workbook is opened.

This is placed in the ThisWorkbook code module.

VBA Code:
Sub Workbook_Open()

     ' Run code here.

End Sub

Before you run the code you will need to check that the action that you are going to perfomr has not already been done.

You could keep a hidden tab which holds a record of when the action was last completed. This tab could hold a history of what, when and who.
 
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