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? 
0
jbeene (3)
3/14/2007 8:46:18 PM
excel.newusers 15348 articles. 2 followers. Follow

4 Replies
249 Views

Similar Articles

[PageSpeed] 30

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 <jbeene@discussions.microsoft.com>
wrote:

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

0
Gord
3/14/2007 11:12:15 PM
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 <jbeene@discussions.microsoft.com>
> wrote:
> 
> >I have a workbook with macro already assigned, how can I copy this into 
> >another workbook? 
> 
> 
0
jbeene (3)
3/15/2007 1:41:37 PM
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 <jbeene@discussions.microsoft.com>
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 <jbeene@discussions.microsoft.com>
>> wrote:
>> 
>> >I have a workbook with macro already assigned, how can I copy this into 
>> >another workbook? 
>> 
>> 

0
Gord
3/15/2007 6:17:52 PM
I am going to try to do as you suggested.  I looked around for an event code 
but…..I’m not sure what that is or where to find it. 

Our developers are trying to figure out what’s going on with the macros; I’m 
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 <jbeene@discussions.microsoft.com>
> 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 <jbeene@discussions.microsoft.com>
> >> wrote:
> >> 
> >> >I have a workbook with macro already assigned, how can I copy this into 
> >> >another workbook? 
> >> 
> >> 
> 
> 
0
jbeene (3)
3/15/2007 6:53:23 PM
Reply:

Similar Artilces:

can't send or receive emails
this just happened this week. I get this message....The connection to the server has failed. Subject 'help', Account: 'mail.comcast.net', Server: 'smtp.comcast.net', Protocol: SMTP, Port: 80, Secure(SSL): No, Socket Error: 10060, Error Number: 0x800CCC0E........your advice to to change smtp port to 25 or 587 or 80 does not work???? Port 80 is definitely wrong for that server; whose advice was that? Comcast wants you to use these email settings: http://www.comcast.com/Customers/FAQ/FaqDetails.ashx?Id=3D2288 Note that the outgoing server now requires port 5...

Access 97 can't resize database window
My database window with the listings of forms tables etc was adjusted to a smaller width, but resizing it is completely disabled and renders Access 2007 utterly useless for me. Is there anyway to 'reset' the window? ...

Can I copy radio buttons so that the second set is independent of.
I have a group of four radio buttons that all point to one cell. My goal is to create a second set that looks identical to the first but which points to a second cell. This is for a questionaire that will have many questions with the same four answer values. I want to be able to quickly create 100 button groups that will each update a separate cell for scoring of the questionaire. There are optionbuttons on the Control toolbox toolbar and there are optionbuttons on the Forms toolbar. Each has different behaviors. If I had to use lots, I'd use the Forms version. Here's a pos...

How can I get 32-bit Integers?
I am using Access MS Office 2007 with VBA 6.5, on Win XP. My Integer type is just 16 bits, i.e. its max value is 32,767. How can I configure it so as to have 32-bit Integers, along with 64-bit Longs? "Renny Bosch" <noname@nospam.com> wrote in message news:OqqNyqmuKHA.4492@TK2MSFTNGP05.phx.gbl... > I am using Access MS Office 2007 with VBA 6.5, on Win XP. My Integer type > is just 16 bits, i.e. its max value is 32,767. How can I configure it so > as to have 32-bit Integers, along with 64-bit Longs? An Access Integer is 16 bits. A Long Integer is...

Formatting a subtotal line with a macro
I already have in use a macro that runs a sort and subtutal function. I would like to format the subtotal row using visual basic since there is already a macro in place. Hi Look at this: ActiveCell.Font.Bold = True Regards, Per "DJDKAL" <daniel.kalfayan@hotmail.com> skrev i meddelelsen news:A86040B0-B4C4-4E11-A80C-E80132C9710F@microsoft.com... >I already have in use a macro that runs a sort and subtutal function. I > would like to format the subtotal row using visual basic since there is > already a macro in place. This is what I've g...

Can SUMPRODUCT be used for entire column?
This formula results in a numeric result: =SUMPRODUCT((A1:A20)*(B1:B20="b")) but this formula results in a #NUM! result: =SUMPRODUCT((A:A)*(B:B="b")) Which means I need to specify the length of the columns, which may grow over time. Any way to do this for the entire column, without having to specify the length of the column? XL07 removed the limitation on array formulas (which SUMPRODUCT is, even though it doesn't require CTRL-SHIFT-ENTER) and entire columns. For pre-XL07, one can use =SUMPRODUCT(A1:A65535, --(B1:B65536="b")) to get all but on...

OE6 can't start due to message store prob
"Outlook Express could not be started. The application was unable to open the Outlook Express message store. Your computer may be out of memory or your disk is full (0x8007000E,5)" This happens after I try to copy in backed up .dbx files. ...

Can't create Organizational Forms Library in Exchange 2003 with SP
Hello, I cannot create an Organizational Form in EFORMS REGISTRY folder (from First Administrative Group->Folders->Public Folders->EFORMS REGISTRY in ESM). When I right-click the EFORMS REGISTRY folder and select New, there is no Organization Form. Instead, I only see Public Folder in the popup menu. Do you have any idea why Organizational Form menu does not show? My Exchange Server is Exchange 2003 with SP2. The login user is Administrator. Could you please help me? Thank you very much. Yang Is that account member of "Enterprise Admins" group? Yang Zhang wrote: &...

Can you delete Business Alerts?
I cannot see any way to delete Business Alerts, can someone tell me how? I am using GP 8.0 -- Sheri Salomone THANKS! Try going to Cards --> System --> Business Alerts. -- Charles Allen, MVP "Sheri Salomone" wrote: > I cannot see any way to delete Business Alerts, can someone tell me how? > I am using GP 8.0 > -- > Sheri Salomone > THANKS! woo hoo! Thank you! -- Sheri Salomone THANKS! "Charles Allen" wrote: > Try going to Cards --> System --> Business Alerts. > -- > Charles Allen, MVP > > > > "Sheri Salo...

Office 2007 forms
I am creating a form with office 2007, will those people who do not use office 2007 be able to fill in my form? should I save it in a particular format? thanks Provided you start from the normal template, don't use fonts that were introduced with Word 2007, and save the form in Word 97-2003 document format, anyone with Word 97 or later should be able to open it. Use only the legacy form fields, to which end http://gregmaxey.mvps.org/Classic%20Form%20Controls.htm will make things easier. -- <>>< ><<> ><<> <>>< ><<...

VB Macro #2
I have a macro that is generating Excel files. When the macro runs, it saves two different tabs in the workbooks as values. It needs to test and wait until the formulas that are pulling amounts from another database are correctly populated with the amounts. Right now, I am getting N/A# instead of amounts for some, but not all, of the files. I think the problem is that the formulas have not completed pulling the amounts before the macro pastes that tab as zeros. (N/A# is what appears when the formulas have not completed calculating - once they have completed, the N/A# is replaced ...

Copy Toolbar
Can someone tell me if there is a way to copy a toolbar I created on my computer to another computer? Thanks for your help! --- Message posted from http://www.ExcelForum.com/ The toolbar settings are in the *.xlb file. -- Regards, Peo Sjoblom "HelpMe >" <<HelpMe.zmcsh@excelforum-nospam.com> wrote in message news:HelpMe.zmcsh@excelforum-nospam.com... > Can someone tell me if there is a way to copy a toolbar I created on my > computer to another computer? Thanks for your help! > > > --- > Message posted from http://www.ExcelForum.com/ > You...

Can the data in a chart table be right justified?
Ecxel 2003 and previous versions of the product center the data in the data columns. Can the data in the columns of a chart table be right justified? In article <DABF738B-6C0D-458B-B082-FA9BD8F126A7@microsoft.com>, =?Utf- 8?B?c2FtIGVhZ2xl?= <sam eagle@discussions.microsoft.com> says... > Ecxel 2003 and previous versions of the product center the data in the data > columns. Can the data in the columns of a chart table be right justified? > Have you tried to format the table? If yes, and you haven't been successful it is probably because XL allows very limited cust...

How do I copy the result of a check box into another check box?
I'm trying to copy the result of a "check box form field" into another check box. For example: if I check (or uncheck) one box in a form, another box later in the protected form will also be checked (or unchecked) , much like the ref + F9 command for the text form field. Is this possible? Thanks. This cannot be done without macros. If your project will allow macros - see http://word.mvps.org/faqs/tblsfldsfms/ExclusiveFmFldChbxs.htm -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> G...

can I snap wrap points to a text box
rather than having to add individual wrap points to the edge of a frame, which is never as accurate anyway, can they be set to 'snap' to a frame (eg the ellipse) so that they are perfectly inline, (and which would of course be a lot quicker)? Edit points will not snap. There are options for edit points, select a point, right click. If you hold down control, the cursor will turn into an x, you can delete a point with a click. Truly a good draw program would be preferable. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com &q...

Why ClassWiard can't see my Class?
I created a class(Class-A), derived a class(Class-B) which derived from CWnd class. When I used mouse right-click on the new-created class, it shows a popup-command-menu which missing "add virtual function" and "add windows message handler". From ClassWizard I couldn't see the new-created class either. I tried to delete myprogram.clw & re-issue ClassWizard, but it doesn't help. Anyone can help ? Thanks, Eagle "EagleChen" <xx@xx> wrote in message news:uRGde941DHA.3496@TK2MSFTNGP11.phx.gbl... > I created a class(Class-A), derived a class(C...

Problem with macro assigned to custom toolbar button
Problem with macro assigned to custom toolbar button I am having a probelm with macros assigned to a custom button on custom button. I am using excel 2000. 1. I have created a macro called "Jump" in a workbook named "Test1" 2. I then created a custom toolbar and added a custom toolbar button t that toolbar. 3. Through the customize dialog box I assign the Macro "Jump" to th custom button. Everything works fine UNTIL. If I do a SAVE AS for the workbook "Test1" and call it something els like "Test2" and then close "Test2" an...

Publisher can not save file
I recently started having troubles with my Publisher 2003. Whenever I go to save my files now, using save as or just the save button, it gives me a dialog box that says "Can not save file." It does that twice, then it disappears. I also noticed that when it does this, it leaves the .tmp files in the directory where I tried to save. I can change the name of the files, and sometimes it will save it. Most of the time not though. I have NAV, and I noticed that it was said there was an issue with Publisher and NAV. Is this the same with the 2005 version, and is this anything anyone...

how can i edit the positioning of the balloon comment in a word fi
how can i edit the positioning of the balloon comment in a microsoft word file ? please reply on my email What you can do is adjust the space reserved for the balloons in the margin. In Word 2007, on the Review tab, click Track Changes, and then click Change Tracking Options. Change the "Preferred width" setting. -- Stefan Blom Microsoft Word MVP "melikelmalik" <melikelmalik@discussions.microsoft.com> wrote in message news:80E5F3D3-04A0-4E81-B154-FA8459B25F00@microsoft.com... > how can i edit the positioning of the balloon comment in a mi...

creating a spredsheet and log the info into another spredsheet
hello, I have a excel sheet that is printed out and a cashier manual enters information, invoice number, invoice amount, cash amount, check amount, amex amount.... I would like to have the cashier input this information on her PC and print a copy to go along with the deposit and at the same time log the information into a google excel document I created. Any ideas how this can be done? ...

Copy HYPERLINKS
I have about 200 entries in col a Some of these entries are hyperlinks to other locations I would like a macro to copy ONLY the hyperlinks from Col a to Col b Currently the hyperlinked items are interspaced over the entire col a, I would like to have all the hyperlinks moved to Col B one under the other with no spaces. Thanks Are they =HYPERLINK functions or Inserted hyperlinks?? -- Gary''s Student - gsnu200750 "pcor" wrote: > I have about 200 entries in col a > Some of these entries are hyperlinks to other locations > I would like a macro to copy ONLY the...

Macros not performing correctly
I recorded a macro to place a vlookup formula in four cells that are side by side. When I run the macro it only performs the first task, it does not go on to do the other three. I used the tab key to go to the next cell while recording the macro, I don't know if that's why it's not working or if it's something else. The script looks like this: Sub EERates() ' ' EERates Macro ' Macro recorded 3/4/2005 by BCBSOK ' ' ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],Sheet1!R3C1:R102C2,2,0)" Range("F15").Select ActiveCell.FormulaR1C...

Report Can Grow not aligned horizontally
I have a report where I have 1 row of text, memo, number, and date fields. The memo field can contain up to 4-5 lines of wrapped text. I have set all teh rows to "can grow". However, on my report, the conditional formatting doesn't grow. For instance, the fill (which I have set to a gray color) in the memo field is about 3 lines deep when there is a lot of text in the memo field, but the text and number fields associated with that record are actually only 1 line. This essentially looks like a mess, small gray filled boxes for the text fields and a large gray ...

How can I print on 8 1/2"x17" paper?
I have cut down an 11x17 paper to 8 1/2" x 17". I cannot figure out how to change the paper size to accept and print anything bigger than 14." any suggestions would be greatly appreciated First make the size settings in the Printer Setup. You may need to use the Custom selection. -- Don Vancouver, USA "mickilena" <mickilena@discussions.microsoft.com> wrote in message news:1AD99AFE-7FE7-4A07-9D20-1B1AFF9856BD@microsoft.com... >I have cut down an 11x17 paper to 8 1/2" x 17". I cannot figure out how to > change the paper size to accept a...

how can I do a lookup into another sheet?
how can I do a lookup into another sheet? thanks ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Try something like =VLOOKUP(123,Sheet2!A1:B10,2,FALSE) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "melawaisi" <melawaisi.ws67m@excelforum-nospam.com> wrote in message news:melawaisi.ws67m@excelforum-nospam.com... > > how can I do a lookup into another sheet? > thanks > > > ------...