Macro Intro
If you are consistently creating a copy of an Excel Workbook you are spending time completing tedious repetitive tasks. Navigating to the Workbook, saving a copy, renaming the new Workbook, and potential creating a new Folder for storage. The good news is there is a better way using VBA! This Excel Macro saves a copy of the Active Workbook. By Default, the Folder Path will be the same location as the Active Workbook. Before saving, this macro will look for a folder named after the current year. Next this macro will look for a folder named as the current month. If either of these folders do not exist, they will be created automatically. The copy of the Active Workbook will be saved to the appropriate Folder Path based on the current year and month. By Default, the New Workbook’s name will be Today’s Date (MM.DD.YYYY). This macro saves you time by completing all the busy work. It is difficult to remain consistent with how you are storing new copies. This Excel macro standardizes storage by creating new folders making it easy to navigate through historical records. Take this macro to the next level and leverage the Excel Calendar Reminder Macros to schedule reoccurring actions on your Outlook Calendar. You can use the Open action to schedule an Excel Workbook to open at a specific time. You can then run this macro from the open Workbook. The Call action automates all of this, opening an Excel Workbook and calling a specific macro within it.See it in Action
Watch this video to see this macro in action.Code
Here is the code for this macro. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Excel 16.0 Object LibraryCustomization
These segments of code can be customized to personalize this macro.If you want to see alerts such as a Workbook copy overwriting an existing one remove this code line
If you want to change the copied Workbook Name refer to the text “” & Format(Date, “MM.DD.YYYY”) in this code line. You can update this to include text and not just the current date. Example: “Company Payroll-” & Format(Date, “MM.DD.YYYY”)
Remove the MsgBox or make it comment to not see it once the macro finishes