+ Reply to Thread
Results 1 to 5 of 5

Code to create new sheet and rename, regardless of any other sheets in workbook

  1. #1
    Registered User
    Join Date
    05-16-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    63

    Code to create new sheet and rename, regardless of any other sheets in workbook

    I've searched quite a bit, but can't find the exact answer I'm looking for.
    I was wondering if anyone could provide the code for the following.
    Create a new sheet and rename it 'FUTA Max"

    I know that seems simple as this
    Please Login or Register  to view this content.
    BUT, this only works if the worksheet created = "Sheet 1". I get a debug error when there is already a Sheet 1 or any other Sheet # for that matter. Somtimes the new worksheet is Sheet 1, sometimes it is Sheet 7, etc..

    I need the code that would create a sheet and rename it to "FUTA Max" no matter what sheets are already in the workbook.
    I've seen many "almost" resolutions that would probably be easily coded to fit my situation, but I am a VBA newb and can't really manipulate other people's code. This is part of a larger macro, but that is the first part.

    Thanks,

    Thanks,
    Last edited by csh8428; 07-18-2012 at 03:56 PM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Code to create new sheet and rename, regardless of any other sheets in workbook

    Try

    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    05-16-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Code to create new sheet and rename, regardless of any other sheets in workbook

    Quote Originally Posted by arlu1201 View Post
    Try

    Please Login or Register  to view this content.
    How do I modify the pivot table code to use this?

    Thanks,

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Code to create new sheet and rename, regardless of any other sheets in workbook

    Replace this line
    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-16-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Code to create new sheet and rename, regardless of any other sheets in workbook

    Thanks you have solved the issue of my initial question, so I will label this thread closed.
    Last edited by csh8428; 07-19-2012 at 02:51 PM.

+ 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