Share via

Move a macro

Anonymous
2013-04-20T20:30:38+00:00

How do you macros from one workbook to another?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2013-04-23T16:48:22+00:00

    Well I used the "drag and drop" suggestion from Chip. It copied the module. Can I now go back to the source file and delete the module there?

    Thanks guys,

    Robert

    Delete if you choose.   No harm if you don't want macros in original workbook.

    Gord

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-04-22T22:39:07+00:00

    Well I used the "drag and drop" suggestion from Chip. It copied the module. Can I now go back to the source file and delete the module there?

    Thanks guys,

    Robert

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-04-20T21:48:11+00:00

     How do you macros from one workbook to another?

    While in VB Editor of workbook one File>Export each module as a *.bas file.

    Open new workbook, open VBE and Import the *.bas file or files.

    Save new workbook.

    Gord

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-04-20T20:47:58+00:00

    Open the VBA editor and then open the Project Window (CTRL R) if it is not already visible, typically on the left side of the screen. Open the "modules" folder of the source workbook and find the module containing the procedure in question. Then, in the destination project, insert a new module (Edit menu, Insert, Module) and then copy and paste the procedure from the source project to the destination project. If you want to move the entire module and all the procedures it contains, you can drag and drop the module from the source project to the destination project. The is no (practical) limit on the number of procedures contained within a single module, so you can copy multiple procedures from the source project to the same module in the destination project.

    Was this answer helpful?

    0 comments No comments