+ Reply to Thread
Results 1 to 11 of 11

Cell A1 Equals Sheet name

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2007
    Posts
    41

    Cell A1 Equals Sheet name

    Attached is summarizing what I am looking for.

    My issue is probably on the internet or even on this site, but I cannot seem to find what I am looking for given the complexity of explaining. Basically, I want the sheet name to equal whatever is cell A1.

    Step 1:
    "project name" in cell 1
    Sheet 1
    Step 2:
    "project name in cell 1
    Sheet 1 now linked/says what is in cell 1("project name")

    The picture should help explain what I what.

    Any help with this process would be greatly appreciated. Thanks.
    Attached Images Attached Images
    Last edited by JoshF; 10-20-2011 at 05:34 PM. Reason: All set

  2. #2
    Registered User
    Join Date
    10-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Cell A1 Equals Sheet name

    Sheets(1).name = Cells(1, 1).Value
    Still not quite sure what you're asking, but throwing this in a module and running it will set the sheet name to whatever text is in the cell A1.
    VBA's going to make me rich one day.

  3. #3
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Cell A1 Equals Sheet name

    try this

    Please Login or Register  to view this content.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  4. #4
    Registered User
    Join Date
    09-21-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Cell A1 Equals Sheet name

    Quote Originally Posted by tom1977 View Post
    try this

    Please Login or Register  to view this content.
    Perfect Thanks. If I wanted to do it on all sheets, I would change ActiveSheet to AllSheet? Thanks

  5. #5
    Registered User
    Join Date
    09-21-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Cell A1 Equals Sheet name

    Quote Originally Posted by tazrockon View Post
    Still not quite sure what you're asking, but throwing this in a module and running it will set the sheet name to whatever text is in the cell A1.
    Thanks for the help and exactly what I was looking for

  6. #6
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Cell A1 Equals Sheet name

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Cell A1 Equals Sheet name

    Whizbang
    Your code will generate error because there is no possibility to have two sheets with the same name

  8. #8
    Registered User
    Join Date
    09-21-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Cell A1 Equals Sheet name

    Quote Originally Posted by tom1977 View Post
    Whizbang
    Your code will generate error because there is no possibility to have two sheets with the same name
    It generates some error, but the code itself works. Strange. Thanks Whiz and Tom. Any idea how to get rid of the generated error?

  9. #9
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Cell A1 Equals Sheet name

    Simply You can not to name two different sheets (in the same workbook) with the same name (from the same cell -check this manually without VBA)

  10. #10
    Registered User
    Join Date
    09-21-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Cell A1 Equals Sheet name

    Quote Originally Posted by tom1977 View Post
    Simply You can not to name two different sheets (in the same workbook) with the same name (from the same cell -check this manually without VBA)
    Thanks Tom for this information and the help today.

  11. #11
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Cell A1 Equals Sheet name

    My code does not use the same cell to name all sheets. It checks cell A1 of each sheet. If two sheets have the same value in their respective A1, then yes, an error would occur. Otherwise, this will run just fine.

+ 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