Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

macros

ResolvedVersion 2003

Colin has attended:
Excel Advanced course

Macros

How can you copy macros between workbooks?

Copying Macros

Hi Colin

To copy macros from one workbook to a nother you need to do the following:

1. Open both workbooks

2. In the Tools menu, select Macro and click Visual Basic Editor

3. In the Visual Basic Editor (VBE) there is a Projects area (in the left panel) displaying the 2 open workbooks as projects (lets call them A and B)

4. in the area of the workbook that is receiving the code (B)make sure that there is a Module. (If not select the Insert Menu and Click Module)

5. In the area of the workbook where the original macro is saved (A) find it in a Module

6. When you found the macro to be copied, highlight the whole macro including the Sub and End Sub lines and Copy.

7. Double click the Module in Workbook B and paste te macro in it.

The macro will now run in its new workbook as normal

Hope this helps

Carlos

Excel tip:

Change the default location for opening and saving spreadsheets

If you are always opening spreadsheets from and/or saving documents to a specific location that is not My Documents, save time by setting this folder as the default for opening files from and saving files to.

Here's how:
1. Go to Tools - Options.

2. Select the General tab.

3. Enter the pathname of the folder you wish to make the default in the Default File Location box (hint: it will be easier to use Windows Explorer to navigate to this folder, then copy and paste the pathname from the address bar at the top of the Windows Explorer screen).

4. Click OK.

You have now changed the default folder for opening and saving spreadsheets.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.