+ Reply to Thread
Results 1 to 9 of 9

Macro to Add Worksheet

  1. #1
    Registered User
    Join Date
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Macro to Add Worksheet

    I'm looking for a macro that will insert/add a new worksheet, and then move that newly created worksheet to the end of the workbook. Sounds simple but I can't figure out how to do it.


    TIA!!
    Last edited by papaexcel; 05-20-2009 at 11:27 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Macro to Add Worksheet

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Macro to Add Worksheet

    Perfect! Thanks!

  4. #4
    Registered User
    Join Date
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Macro to Add Worksheet

    One other request...I also want a macro that will delete all existing worksheets in a workbook (sometimes as many as 30 worksheets) except for Sheet1 and Sheet2.

    Again, TIA!!

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Macro to Add Worksheet

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Macro to Add Worksheet

    thanks, works great.

    I found out the following works equally as well...

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Macro to Add Worksheet

    My problem continues to grow!! Thanks a ton for the help already.

    But now I need to do one more thing. When I use the above macro to create a new worksheet and move it to the end of the workbook, I want to also automatically rename that worksheet based on the the cell "A1" in "Sheet1". Incidentally, cell "A1" in "Sheet1" will always be a date, but I plan having it formated such that it reads 5-15-09. Thus I would want the sheet name of the newly created sheet to read 5-15-09.

    Any ideas?

    Again, thanks for all the help.

  8. #8
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Macro to Add Worksheet

    Please note that an error will be generated if there's nothing in cell A1 on sheet1

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    05-07-2009
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Macro to Add Worksheet

    Worked great. Thanks again...you've been most helpful.

+ 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