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.
First time using VBA? You just need to complete 3 easy steps that only take a couple minutes to complete: Activate the Developer Tab, Update Macro Security, Setup References for Leverage & Lean macros. I'll show you how to do all of this in this Macro Monday video!
Want to make this macro your own? These lines of code can be customized to personalize this macro.
8. Application.DisplayAlerts = False 'Hide Display Alerts If you want to see alerts such as a Workbook copy overwriting an existing one remove this code line
24. Application.ActiveWorkbook.SaveAs Filename:=FilePath & "\" & Format(Date, "MM.DD.YYYY") & Right(ActiveWorkbook.FullName, (Len(ActiveWorkbook.FullName) + 1) - InStrRev(ActiveWorkbook.FullName, ".")) 'Save copy to Active Workbook File Path\Current Year\Current Month 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”)
26. MsgBox "A copy of this Active Workbook named """ & Format(Date, "MM.DD.YYYY") & Right(ActiveWorkbook.FullName, (Len(ActiveWorkbook.FullName) + 1) - InStrRev(ActiveWorkbook.FullName, ".")) & """ has been saved to the following location:" & vbNewLine & vbNewLine & Left(FilePath, InStr(1, ActiveWorkbook.FullName, ActiveWorkbook.Name) - 1) Remove the MsgBox or make it comment to not see it once the macro finishes
#LeverageLean #LessClicksMoreResults #MacroMonday #VBA #Macros
Checkout this Excel Macro page: https://leveragelean.com/macros/Excel...
Find more content on our website: https://leveragelean.com
Watch all of our Macro Monday Videos on our YouTube playlist: • Macro Instructions | Macro Mondays
Subscribe to our YouTube Channel to stay up to date on all of the videos we are posting.
/ @leveragelean
Like us on Facebook: / leveragelean
Follow us on Twitter: / leveragelean
Connect with us on LinkedIn: / brentschneider-leveragelean
Check us out on Instagram: / leveragelean
Leverage & Lean is focused on improving computer processes by Leveraging programming and applying Lean principles. It is our goal to make you more efficient and effective on your computer producing "Less Clicks and More Results!" To see our content visit LeverageLean.com where we have Visual Basic Applications (VBA) Macros in Excel, Outlook, and Word that automate repetitive computer tasks. You can start using this macro today for FREE, No Charge, No Gimmicks!!! Come visit us and watch our additional Macro Instructions videos to see how to implement our VBA macros in your computer processes and customize them meet your specific needs. Macros helps save time and time is money it’s as simple as that! Also, walkthrough our PDF Tutorials step by step or watch our See How videos to utilize computer settings that have been hiding in plain sight. Read our weekly Insights that open your mind and challenge you to start improving your computer processes. Leverage & Lean Insights are a quick read (less than 1 minute on average) but can be a great reset to your day and help you focus on how to start winning on your computer!
Stay Awesome,
Brent Schneider
Leverage & Lean
Est. 2017