+ Reply to Thread
Results 1 to 5 of 5

[SOLVED]Macro to create new worksheets

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    7

    [SOLVED]Macro to create new worksheets

    Hello,

    I'm trying to figure out how to create a Macro that will create a new worksheet at the very end of all the current sheets. I want the macro to first come up with an InputBox, and whatever the user types into that Input box will be the new name of the Worksheet. I also want this worksheet to be identical to the Template worksheet I already have in the Workbook.

    I thought this would be easy to code but I'm having some trouble of course

    Here is what I have so far:

    Please Login or Register  to view this content.
    If I delete the bottom 4 Lines, it will create a new blank worksheet named after what I input into the InputBox. I just cannot seem to get it to copy the Template worksheet and Paste it into the newly created worksheet. Any help, as always, would be greatly appreciated!

    ALSO: If there is a way to have an error message, or just have the macro stop if the user enters something that cannot be a worksheet name, that would be extra awesome

    Thanks!
    Last edited by signgain82; 01-17-2012 at 09:13 AM.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Macro to create new worksheets

    Hey , Is this what you are after?

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro to create new worksheets

    This works perfectly and is 10x cleaner than my attempt, I have a lot to learn! Thank you so much, +rep!

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Macro to create new worksheets

    Thanks. Don't worry , I also still have a lot to learn myself.

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

    Re: Macro to create new worksheets

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    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!)

+ 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