How to Copy & Paste Macro for Excel

by Stephanie Ellen
Macros can replace tedious functions in spreadsheets.

Macros can replace tedious functions in spreadsheets.

Microsoft Excel macros can replace tedious functions in Excel spreadsheets. For example, instead of typing the same information over and over again, you can create a macro to do the work for you. Macros are workbook specific, which means that if you want the macro in one workbook to work in another workbook, you have to copy the macros over. Copying a macro can be done through the Visual Basic Editor (VBE), which is built into Excel.

1

Open the workbook that has the macro you want to copy.

2

Press the "Alt" and "F11" keys together to access the VBE.

3

Click on the name of the macro you want to copy in the left-hand column. This opens up a window with the Visual Basic for Applications (VBA) code.

4

Click on the "Edit" tab and then click on "Select All."

5

Click on "Ctrl" and "C" to copy the macro to the Office Clipboard.

6

Open the workbook where you want to copy the macro to.

7

Press the "Alt" and "F11" keys together to open the VBE.

8

Click on "Insert" and then click on "Module" to open a blank window.

9

Click inside the blank window, then press the "Ctrl" and "V" keys to paste the code into the open window. Your macro is now copied and ready for use.

10

Press the "Alt" and "F11" keys together to exit the VBE and return to your workbook.

Tip

  • check When you save your workbook, the macro is automatically saved along with the workbook contents.

Items you will need

About the Author

Stephanie Ellen teaches mathematics and statistics at the university and college level. She coauthored a statistics textbook published by Houghton-Mifflin. She has been writing professionally since 2008. Ellen holds a Bachelor of Science in health science from State University New York, a master's degree in math education from Jacksonville University and a Master of Arts in creative writing from National University.

Photo Credits

  • photo_camera number background image by kuhar from Fotolia.com