How To Copy A Macro

Table of contents:

How To Copy A Macro
How To Copy A Macro

Video: How To Copy A Macro

Video: How To Copy A Macro
Video: How to Copy or Import VBA Code to Another Workbook 2024, December
Anonim

One of the recurring problems when copying a macro from a selected document or template to a desired one is the need to change or copy the settings of a document or template. It is recommended to use copies of selected documents or templates containing macros.

How to copy a macro
How to copy a macro

Necessary

Microsoft Word, Microsoft Excel, Visual Basic

Instructions

Step 1

Make sure the Word macros are working and open the selected document.

Step 2

Go to the Visual Basic Editor by pressing ALT + F11 at the same time.

Step 3

Select the Compile section in the Debug service menu and wait for a message about the successful completion of the operation. Otherwise, it is necessary to check the lists of attached files.

Step 4

Return to the Visual Basic Editor and go to the Tools menu.

Step 5

Select the References section and uncheck (or omit) the checkboxes in the required fields.

Use the organizer utility to copy a portion of a document or template.

Step 6

Open the Macros window by pressing ALT + F8 at the same time.

Step 7

Click the Organizer button.

Step 8

Follow the directions in the app.

Follow these steps to copy Microsoft Excel macros.

Step 9

Select "Options" from the "Tools" menu and go to the "Security" tab.

Step 10

Click the Macro Security button in the Macro Security section and click the Macro Security Level tab.

Step 11

Specify "Medium" or "Low" in the "Macro Security Level" field.

Step 12

Select the workbook containing the required macro and open it.

Step 13

Select the "Macro" item in the "Tools" menu and execute the "Macros" command.

Step 14

Specify the name of the macro selected for copying in the "Macro name" line.

Step 15

Click the "Change" button.

Step 16

Make sure that the Sub and End Sub lines are included in the part of the macro to be copied to copy the entire macro, or select those lines that contain the part of the macro to be copied.

Step 17

Click the "Copy" button in the toolbar of the program window.

Step 18

Open the module to be modified and click the "Insert" button.

Recommended: