Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office Excel
Search
Search
 
Check for updates: (c) Microsoft
Office downloads
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Email this linkEmail this link Printer-Friendly VersionPrinter-Friendly Version Bookmark and ShareShare
Copy a macro module to another workbook
 
  1. If the Developer tab is not available, do the following to display it:
    1. Click the Microsoft Office Button Button image, and then click Excel Options.
    2. In the Popular category, under Top options for working with Excel, select the Show Developer tab in the Ribbon check box, and then click OK.

       Note   The Ribbon is a component of the Microsoft Office Fluent user interface.

  2. To set the security level temporarily to enable all macros, do the following:
    1. On the Developer tab, in the Code group, click Macro Security.

      Excel Ribbon Image

    2. In the Macros Settings category, under Macro Settings, click Enable all macros (not recommended, potentially dangerous code can run), and then click OK.

     Note   To help prevent potentially dangerous code from running, we recommend that you return to any of the settings that disable all macros after you finish working with macros.

  3. Open the workbook that contains the module (module: A collection of declarations, statements, and procedures stored together as one named unit. There are two types of modules: standard modules and class modules.) that you want to copy and the workbook that you want to copy the module to.
  4. On the Developer tab, in the Code group, click Visual Basic.
  5. On the View menu, click Project Explorer Button image.
  6. Drag the module that you want to copy to the destination workbook.
advertisement