![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 25
|
We are jointly working on a template workbook. I have created a macro & worksheet that need to be pasted into another workbook. When I try to insert/module and paste macro into another workbook - it still launches my original workbook and runs the macros from there. Help!
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Is your macro in a module or on the workbook object? I'm guessing it's in a module since your calling it a macro.
My advice is to go to the macro, select all and then copy. Go to the sheet that you're exporting, right click on the Name TAB, choose "View Code" and then paste your macro code into the VBE window that comes up. HTH Actually, do you want to post the code that you use to call your macro. That might be helpful. _________________ [b] Mark O'Brien [ This Message was edited by: Mark O'Brien on 2002-03-28 07:59 ] |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 25
|
Thanks - I pasted into Viewcode and moved sheet to new workbook. Got error message. Pasted to VB windows as Thisbook. Then edited each button and reassigned macro. Then it worked without calling my other workbook. Muchos Gracias!
|
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2011
Posts: 4
|
Actually you can export it.
At the top left pane of the Visual Basic Editor (ALT + F11), highlight the module, and right click and select EXPORT. Open the destination workbook and from FILE select IMPORT. Save the time in copy and pasting. HTH Henry |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|