Macro Intro
If you have copied a worksheet in an Excel Workbook using the Move or Copy activity, then you know that there is much to be desired during this experience. Because this activity is designed to Move or Copy multiple clicks must be made to copy the Excel Worksheet where and how you want. It is easy to forget the small checkbox confirming you want to Copy the Excel Worksheet and not Move it which is the default behavior. The Move or Copy activity gives the appearance that you can only copy one Excel Worksheet at a time but that is not the case. You can use Ctrl or Shift to make multiple selections of Excel Worksheets before accessing the Move or Copy activity. We noticed all of this at Leverage & Lean which is why we created the Excel Copy All Worksheets macro! This Excel macro will loop through all available worksheets and copy then either immediately after the current worksheet or append to the end of all available worksheets. You will be prompted to decide via a Message Box on the Excel Worksheet copying behavior. While the Message Box can be helpful if you vary between copying worksheets immediately after or at the end of all worksheets. If this is not the case the Excel Copy All Worksheets macro can easily be set to a default copy behavior or even split out into two separate macros to avoid the prompt all together. Not only does this Excel macro provide a fast way to copy all worksheets in an Excel Workbook it also gives you the opportunity to customize the naming convention of the newly copied worksheet with some simple code updates. If you are looking for something more robust and simply put AWESOME, then checkout our Insider version of the Excel Copy All Worksheets macro! The Insider version of this Excel macro will allow you to only copy the worksheets you select vs the entire worksheet collection. Also, if you want to copy worksheets to a different Excel Workbook this macro will prompt you to select between the Active Excel Workbook vs other Excel Workbooks currently open!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 Library
Insider Content
Here is the Insider code for this macro. Brief Description of differences between FREE Code and Insider Code. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Excel 16.0 Object Library