Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Moving Macros from the Personal Workbook.

Moving Macros from the Personal Workbook

by Allen Wyatt
(last updated March 21, 2015)

6

It is not uncommon to place frequently used macros in the Personal.xlsb workbook. By placing them there, you are able to have the macros available all the time while you are using Excel. At some point, however, you may want to move the macros to a different workbook. For instance, you may want to place them in a workbook so they are easily accessible by anyone else opening the workbook.

To move macros from the Personal.xlsb workbook to a different workbook, follow these general steps:

  1. Make sure the workbook that is the target of your macro transfer operation is loaded.
  2. Unhide the Personal.xlsb file by displaying the View tab of the ribbon and clicking Unhide within the Window group.
  3. Press Alt+F11 to display the VBA editor.
  4. Using the Project window, display the macros that you want to move.
  5. Select (highlight) and cut (Ctrl+X) the macros from their original location in Personal.xls.
  6. Using the Project window, display the module in the workbook where you want the macros to be. (If there is not an existing module in the workbook, you may need to create one.)
  7. Paste (Ctrl+V) the macros in the module.
  8. Close the VBA editor.
  9. Hide the Personal.xlsb file by displaying the View tab of the ribbon and clicking Hide within the Window group.
  10. Close and save the workbooks.

It should be noted that when you move the location of the macros, the address by which they are called and invoked is also changed. Thus, if you have any menu items or toolbar buttons that were used to run the macros, these will need to be changed to point to the new location.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10370) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Moving Macros from the Personal Workbook.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Updating Links

When you establish links between data on a target worksheet and data on a source worksheet, those links are typically updated ...

Discover More

Determining If a Number is Odd or Even

Need to know if a number in a macro is odd or even? It's easy to figure out with the simple calculation shown in this tip.

Discover More

Working with Record Numbers

Want to keep track of various rows in a data table through the use of record numbers? Here are some options and ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Personal Workbook Fails to Load

The Personal workbook is special; it is where you can store macros you want to use all the time in Excel. What do you do, ...

Discover More

Saving Changes in the Personal Workbook

The Personal workbook is a special place used to store information and macros that you can access from all the other ...

Discover More

Opening Personal.xlsb

If you start up Excel and all you see is your Personal.xlsb file, then you may wonder what you are doing wrong. The answer is ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 4?

2016-12-14 03:42:00

Asha

Hi,

can any one help me. i am new to VBA. i created one dashboard which will open files in my folder and run macro. i want to share this to another system. i am sure it wont work bcz of path which i gave. can anyone help me on this by step by step how i make this file to use by my other friends as well. its quite important. please help me.


2015-03-27 13:29:33

P.Samuel

Hi Sir,

I Want to learn Excel VBA (MIS Reporting)
so can you please help me out how should I put a step forward.


Thanks and Regards,
P.Samuel


2015-03-23 09:24:12

Col Delane

With both the source workbook (Personal.xlsb) and destination workbook open, via the VBE you can also just drag & drop the whole module holding the desired macros from one file to the other (hold down Ctrl to copy).


2015-03-22 08:18:58

John Massiass

Yes dear @Brian, we can export it to a .bas file, by which we can apply the code on any file we need.

Another advantage is for modification, this way you will have to modify one file only, rather than all the files have the same code :)


2015-03-21 10:13:45

Brian L.

I don't have Excel in front of me now, but I think you can also use the Export feature in the VBA editor to save the macro to an external file. That way it can be distributed and the recipient can Import the macro into whatever worksheet they want.


2015-03-21 06:03:33

Tony Davis

The topic was of the tip was "moving" a macro so that's why you'd use CTR-X to cut the macro from the original location.

You could always "copy" the macro using CTRL-C so that you retain a copy in case someone deletes the macro or thw target workbook.

I save all my macros in a workbook called "@@Excel Macros" - it's easy for me to let other people have a copy and all you need to do is to have the s/sheet open when you're trying to call a macro. This is the first one I open when I boot up my lapatop.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.