+ Reply to Thread
Results 1 to 2 of 2

Macro in sheet

  1. #1
    Registered User
    Join Date
    05-26-2005
    Posts
    56

    Macro in sheet

    Ok i have a macro that is written in a template workbook. The idea is that the template is then copied into a variety of sheets and the macro is run to pick up various pieces of standing data, what i am struggling with is a way of ensuring the macro stays with the sheet when it is copied into a new work book.

    Any ideas?

  2. #2
    Tom Hutchins
    Guest

    RE: Macro in sheet

    Put the macro inthe code module for the sheet that will be copied to the
    other workbooks. The macro will be copied with the sheet.

    If your macro is a user-defined function which is called from the worksheet,
    the code must be in a VBA code module. The following link to Erlandsen Data
    Consulting's VBA site has code for copying a module from one workbook to
    another:

    http://www.erlandsendata.no/english/...vbavbecopytowb

    Hope this helps,

    Hutch

    "chalky" wrote:

    >
    > Ok i have a macro that is written in a template workbook. The idea is
    > that the template is then copied into a variety of sheets and the macro
    > is run to pick up various pieces of standing data, what i am struggling
    > with is a way of ensuring the macro stays with the sheet when it is
    > copied into a new work book.
    >
    > Any ideas?
    >
    >
    > --
    > chalky
    > ------------------------------------------------------------------------
    > chalky's Profile: http://www.excelforum.com/member.php...o&userid=23758
    > View this thread: http://www.excelforum.com/showthread...hreadid=563293
    >
    >


+ 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