+ Reply to Thread
Results 1 to 5 of 5

Transfering Macro(s) to New Workbook - Help Req'd

  1. #1
    Forum Contributor
    Join Date
    06-24-2009
    Location
    SCOTLAND
    MS-Off Ver
    Excel Version 2108
    Posts
    144

    Transfering Macro(s) to New Workbook - Help Req'd

    I’m using the following code to create a new workbook which will include sheets that have been ticked on the ‘System Selector’ sheet. For testing purposes the only sheet available at present is the ‘System 66-Inert Gas’. Eventually there will be a sheet in this workbook for all the systems listed on ’System Selector’.
    The macro ‘mainLW3’ is working fine. It creates a new wb with the ‘Master’ and ‘System 66 – Inert Gas’ sheets, when the check box is ticked. However, it does not copy the macros from the original ‘System 66 – Inert Gas’ sheet. These are the ‘CheckedBy’ macros.
    How can this be achieved? I noticed that the created wb saves as an xlsx not an xlsm!
    I’ve attached a test copy of the wb to help out. Note this will save to drive D: if not changed.
    Any help appreciated.
    Attached Files Attached Files
    Last edited by heliskier89; 06-19-2011 at 03:31 PM. Reason: Prefix changed to SOLVED.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Transfering Macro(s) to New Workbook - Help Req'd

    Have a template workbook with all the sheets in & use code to delete the sheets that are not needed. Then save the workbook as a different name
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    06-24-2009
    Location
    SCOTLAND
    MS-Off Ver
    Excel Version 2108
    Posts
    144

    Re: Transfering Macro(s) to New Workbook - Help Req'd

    Smart thinking. I'll look into this method.

    I'm assuming that you're of the understanding that my proposed method can't be acheived! Is this the case, that code can't be transferred this way?

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Transfering Macro(s) to New Workbook - Help Req'd

    Hi heliskier89
    Yes, you can do as you described...see this link
    http://www.cpearson.com/excel/vbe.aspx

    As you can see from the link, the process is quite convoluted. royUK's approach is much simpler and more direct.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Contributor
    Join Date
    06-24-2009
    Location
    SCOTLAND
    MS-Off Ver
    Excel Version 2108
    Posts
    144

    Re: Transfering Macro(s) to New Workbook - Help Req'd

    Thanks all for your help. I chose the easier route ie. deleting sheets from a template.

    I've included the link to the thread which solved my problem here.

    http://www.excelforum.com/excel-prog...box-false.html

    Thanks all.

+ 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