+ Reply to Thread
Results 1 to 3 of 3

Inserting and Naming Sheets

  1. #1
    Registered User
    Join Date
    03-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    37

    Question Inserting and Naming Sheets

    This is probably very simple but I am not sure how to do it. Here is the code I recorded to insert a new sheet in a workbook.

    Sheets.Add After:=Sheets(Sheets.Count)
    Sheets("Sheet34").Select
    Sheets("Sheet34").Name = "Billed Summary"

    My problem is the name "sheet34" is not always "sheet34" so the next line does not reference the right name. Can you give the sheet a name when you insert it?
    Last edited by jcranst; 05-30-2013 at 09:54 AM.

  2. #2
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Inserting and Naming Sheets

    Hi jcranst.

    Can you please explain little bit more, what you are going to accomplish finally.
    Cheers,

    Joshi
    Being with a winner makes you a winner

  3. #3
    Registered User
    Join Date
    10-06-2009
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Inserting and Naming Sheets

    Hi,

    First time for me answering a question!

    Declare the sheet and a name first, then add that sheet. I'd also set up some code to check if the sheet name exists, see what I've done below (adds a sheet before Sheet2, but you might get your sheet name or the before sheet from somewhere else in your workbook or code).

    Cheers
    Steve


    Please Login or Register  to view this content.
    Last edited by Steve_Courts; 05-30-2013 at 10:30 AM.

+ 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