+ Reply to Thread
Results 1 to 2 of 2

How to copy macro to another workbook with VBA

  1. #1
    Registered User
    Join Date
    06-28-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    How to copy macro to another workbook with VBA

    Hi,

    I am trying to write VBA routine from workbook "A" which will copy the VBA subroutines to a workbook "B" (Module 2 in my code). I then want to create a button in Workbook B and assign one of the macro's copied over to this button.

    I currently have the following code which does almost everything I want, but it uses the macro from the original (workbook A) module.

    Please Login or Register  to view this content.

    How do i get the macro button to use the local module, not the original module? Note, the new workbook is created dynamically so its name will vary (Stored in "outputWB" in my code).

    Thanks in advance for any assistance.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: How to copy macro to another workbook with VBA

    one way of doing it is parking the macro in personal.xls file which always opens but hidden whehever an excel file is opned. In that macro regarding the workbook(file)name you put an input box to specify the filename whenever you use the macro in ANY file or workbook. do you get me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1