
- #SELECT EXCEL FILE THAT WORKS BOTH FOR MAC AND WINDOWS VBA HOW TO#
- #SELECT EXCEL FILE THAT WORKS BOTH FOR MAC AND WINDOWS VBA CODE#
#SELECT EXCEL FILE THAT WORKS BOTH FOR MAC AND WINDOWS VBA CODE#
Option 2 – Drag and Drop a ModuleĪnother way to insert code into a workbook is to drag and drop a code module from one book to another. If you do not save your file as a macro-enabled workbook, then the VB code you copied will not be able to run. Once you have selected that option from the drop-down menu for the file type, just click Save. Then you want to change the file type to be an Excel Macro-Enabled Workbook (.xlsm). When you go to save your workbook, you may receive this prompt, asking you if you want to ignore the code and save it as a macro-free workbook. Saving Your Workbook as a Macro-Enabled FileĪny time you are placing a macro into an Excel file that doesn't already have them, it's important that you save the file as a macro-enabled workbook (.xlsm). That's where you are going to paste the code that you copied in Step 1.

This could be from previous projects you created, code you found on the web, or a macro from your own personal macro workbook.

If you're relatively new to Macros and VBA, then you might want to use code from other sources. M_TOC.bas (2.3 KB) Copying or Importing VBA Code

The file I use in the example can be found here:
#SELECT EXCEL FILE THAT WORKS BOTH FOR MAC AND WINDOWS VBA HOW TO#
In Option 4 below, I'll show you how to import a basic file (.bas) into your workbook. Bottom Line: Learn how to insert VBA code into your worksheets using four different techniques.
