Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying,importing/exporting Macros in Excel?

Status
Not open for further replies.

hyposmurf

Technical User
Sep 2, 2003
28
GB
How can I copy macros from Excel on one machine to another,is it possible to export and import them?Or maybe I could just copy the files,but where are they stored?I need to copy them so I can use them on my home pc and have created them at work.
 

(1) Open the xls file that has your macros
(2) Press Alt-F11. Now the Visual Basic Editor will open
(3) On the left hand side, you will see a "Project Explorer" window. Here, locate your file/project.
(4) Now, watch for "Modules". Here your macros will be residing in one or more modules. Let us assume there is just one module.
(5) Right Click on this module. "Export File..."
(6) Your macros will be exported to Yourname.bas
(7) Take these *.bas files wherever you want.
(8) Open the excel file where you want these macros to be loaded.
(9) Get to this project explorer, then from the File menu, try "Import File".

Hope this helps.
-Jay
 
Or you can just copy the text of the macros, and then paste into the destination file (in the macro editor, of course).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top