Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default How can I copy a macro into another workbook?

I have a workbook with macro already assigned, how can I copy this into
another workbook?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default How can I copy a macro into another workbook?

Basically you just open the module in which the macro resides and select the
text from Sub macro() to End Sub.

Copy it and paste into a module in your other workbook.

But......nothing is rarely that simple<g

Is the macro workbook-specifice or worksheet-specific?

Does it refer to named ranges in the original workbook?

If you could post the code perhaps we could get a better idea of how to copy and
edit if needed.


Gord Dibben MS Excel MVP

On Wed, 14 Mar 2007 13:46:18 -0700, jbeene
wrote:

I have a workbook with macro already assigned, how can I copy this into
another workbook?


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default How can I copy a macro into another workbook?

Hello,

It is workbook specific and it refers to name ranges. In my workbook there
are 16 different macros and 4 sheets. Its a form that I send through our
web based program, when it goes through our system it stripes the form of the
macros. I was trying to find a way to add the macros back onto the form
after it goes through our system.

Jodell

"Gord Dibben" wrote:

Basically you just open the module in which the macro resides and select the
text from Sub macro() to End Sub.

Copy it and paste into a module in your other workbook.

But......nothing is rarely that simple<g

Is the macro workbook-specifice or worksheet-specific?

Does it refer to named ranges in the original workbook?

If you could post the code perhaps we could get a better idea of how to copy and
edit if needed.


Gord Dibben MS Excel MVP

On Wed, 14 Mar 2007 13:46:18 -0700, jbeene
wrote:

I have a workbook with macro already assigned, how can I copy this into
another workbook?



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default How can I copy a macro into another workbook?

You could just export the module(s) with the macros as *.BAS files then
re-import those back in after the workbook has gone through the system.

Do you have any event code in the 4 sheets or in the Thisworkbook module?

You will have to export those as *.CLS files and re-import them as Class
Modules, copy the code to your 4 sheets then delete the Class modules.

Chip Pearson has a series of macros for adding modules to a workbook.

http://www.cpearson.com/excel/vbe.htm

BTW.........how does your system actually strip the macros from the file?


Gord


On Thu, 15 Mar 2007 06:41:37 -0700, jbeene
wrote:

Hello,

It is workbook specific and it refers to name ranges. In my workbook there
are 16 different macros and 4 sheets. It’s a form that I send through our
web based program, when it goes through our system it stripes the form of the
macros. I was trying to find a way to add the macros back onto the form
after it goes through our system.

Jodell

"Gord Dibben" wrote:

Basically you just open the module in which the macro resides and select the
text from Sub macro() to End Sub.

Copy it and paste into a module in your other workbook.

But......nothing is rarely that simple<g

Is the macro workbook-specifice or worksheet-specific?

Does it refer to named ranges in the original workbook?

If you could post the code perhaps we could get a better idea of how to copy and
edit if needed.


Gord Dibben MS Excel MVP

On Wed, 14 Mar 2007 13:46:18 -0700, jbeene
wrote:

I have a workbook with macro already assigned, how can I copy this into
another workbook?




  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default How can I copy a macro into another workbook?

I am going to try to do as you suggested. I looked around for an event code
but€¦..Im not sure what that is or where to find it.

Our developers are trying to figure out whats going on with the macros; Im
their little pain right now.

Thank you for your help.


"Gord Dibben" wrote:

You could just export the module(s) with the macros as *.BAS files then
re-import those back in after the workbook has gone through the system.

Do you have any event code in the 4 sheets or in the Thisworkbook module?

You will have to export those as *.CLS files and re-import them as Class
Modules, copy the code to your 4 sheets then delete the Class modules.

Chip Pearson has a series of macros for adding modules to a workbook.

http://www.cpearson.com/excel/vbe.htm

BTW.........how does your system actually strip the macros from the file?


Gord


On Thu, 15 Mar 2007 06:41:37 -0700, jbeene
wrote:

Hello,

It is workbook specific and it refers to name ranges. In my workbook there
are 16 different macros and 4 sheets. Its a form that I send through our
web based program, when it goes through our system it stripes the form of the
macros. I was trying to find a way to add the macros back onto the form
after it goes through our system.

Jodell

"Gord Dibben" wrote:

Basically you just open the module in which the macro resides and select the
text from Sub macro() to End Sub.

Copy it and paste into a module in your other workbook.

But......nothing is rarely that simple<g

Is the macro workbook-specifice or worksheet-specific?

Does it refer to named ranges in the original workbook?

If you could post the code perhaps we could get a better idea of how to copy and
edit if needed.


Gord Dibben MS Excel MVP

On Wed, 14 Mar 2007 13:46:18 -0700, jbeene
wrote:

I have a workbook with macro already assigned, how can I copy this into
another workbook?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Macro to copy some date from one Workbook to another. dk_ Excel Discussion (Misc queries) 0 November 10th 06 07:59 AM
Copy macro to another workbook FTM Excel Discussion (Misc queries) 4 September 21st 06 08:48 PM
Updating copy of Macro workbook... have_a_cup Excel Discussion (Misc queries) 2 June 29th 06 03:13 PM
macro to copy and paste into another workbook spirosu Excel Discussion (Misc queries) 1 March 15th 06 06:26 PM
copy text from 1 workbook to another by macro bigdaddy3 Excel Worksheet Functions 0 August 17th 05 06:20 PM


All times are GMT +1. The time now is 11:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"