+ Reply to Thread
Results 1 to 5 of 5

Fix macro to work when worksheets are added

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    Keene, NH
    MS-Off Ver
    Excel 2010
    Posts
    3

    Fix macro to work when worksheets are added

    I have a macro that was working well. It was copying the outputs from 2 merged & concatenated cels, and pasting the results into a separate worksheet. However, I have another macro that launches a new blank worksheet/form and it adds changes the worksheet name by NEW PLATE, then NEW PLATE (2), NEW PLATE (3) and so on. As a result, my maco fails.

    In addition to the needed fix, I would also like to have the macro paste the data into another workbook as well.

    Please Login or Register  to view this content.
    Thank you
    Last edited by JBeaucaire; 04-02-2013 at 06:59 PM. Reason: Added code tags, as per Forum Rules. Don't forget! Read the rule in the menu bar above. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Fix macro to work when worksheets are added

    Try this.... instead of needing a specific sheet, it "COPIES" from whatever the activesheet is and pasted into the SUMMARY without activating it first, that's not necessary.
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 04-02-2013 at 07:17 PM. Reason: Corrected code
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-19-2013
    Location
    Keene, NH
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Fix macro to work when worksheets are added

    Thank you JBeaucaire,

    Your code eliminated the problem with the changing worksheet names. Works great. Did you have any thoughts on the second part of my question?

    "In addition to the needed fix, I would also like to have the macro paste the data into another workbook as well."

    Thanks again!!!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Fix macro to work when worksheets are added

    What workbook? Full explanation.

  5. #5
    Registered User
    Join Date
    03-19-2013
    Location
    Keene, NH
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Fix macro to work when worksheets are added

    I want to do everything the same as it is now, but in addition, also paste the data into a separate excel workbook, whereas the the data is currently being pasted into a separate worksheet in the same workbook

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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