+ Reply to Thread
Results 1 to 8 of 8

Need a Macro to Copy Worksheet template into the same workbook

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    stockton, ca
    MS-Off Ver
    Excel 2003
    Posts
    29

    Need a Macro to Copy Worksheet template into the same workbook

    This forum has been outstanding in helping me with my workbook. I need a macro to respond to a button click event that creates a copy of the worksheet, "TEMPLATE." It should land inside the same workbook, complete with all of "TEMPLATE"'s charts and formulas. Much appreciated.

  2. #2
    Registered User
    Join Date
    10-22-2012
    Location
    stockton, ca
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Need a Macro to Copy Worksheet template into the same workbook

    I kept searching and found this which does what I want, but I would like to add to it. It'd be nice to have a mesage box come up asking for a name to put into the new worksheet tab and then to have it automatically alphabetize itself.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need a Macro to Copy Worksheet template into the same workbook

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    10-22-2012
    Location
    stockton, ca
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Need a Macro to Copy Worksheet template into the same workbook

    Great! Totally beyond what I can do with vba right now.

    One problem is that when I hit "cancel" it gives me a runtime 1004 error message.

    Please Login or Register  to view this content.
    The part I have in yellow is actually highlighted in yellow in the module. When I right click and go to "definition," it says that it "cannot jump to 'ActiveSheet' because it is hidden."

    Also, how could you make cell A2 match what is put into the message box? That is, cell A2 should match what is said on the worksheet tab.

    Moderator's Note: As per Forum Rule #12, don't quote whole posts unless necessary-- it's just clutter...Thanks.
    Last edited by jeffreybrown; 12-07-2012 at 09:03 PM.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need a Macro to Copy Worksheet template into the same workbook

    That's weird - is it hidden??? - Try this:

    Please Login or Register  to view this content.
    Last edited by xladept; 12-07-2012 at 09:03 PM.

  6. #6
    Registered User
    Join Date
    10-22-2012
    Location
    stockton, ca
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Need a Macro to Copy Worksheet template into the same workbook

    No, I don't have it hidden. It's a workbook I am working on at my job, not at home. I'll try it out on Monday, thanks for the follow up.

  7. #7
    Registered User
    Join Date
    10-22-2012
    Location
    stockton, ca
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Need a Macro to Copy Worksheet template into the same workbook

    Works great, thank you!

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need a Macro to Copy Worksheet template into the same workbook

    You're welcome!

+ 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