+ Reply to Thread
Results 1 to 6 of 6

How to change a tab name with cell reference and formula?

  1. #1
    Jared
    Guest

    How to change a tab name with cell reference and formula?

    I would like to automatically change a tab's name from cell A1 but the
    problem starts because cell A1 is in reference from a different sheet so it
    automatically changes and i don't input it manually. All tries i made worked
    only manually using the VBA.

    Cell A1 inputs: =""&Intro!A3&" 7"
    How can i change Cell "A3" in Sheet "Intro" So the tab's name will change
    accordingly?

    Thanks, Jared

  2. #2
    Gary L Brown
    Guest

    RE: How to change a tab name with cell reference and formula?

    You're going to have to put some VBA code in the worksheet who's name you
    want to keep changing.

    Because you will be changing the name of the worksheet, you obviously can't
    refer to the worksheet name in your code. BUT, besides the name that you see
    on the tab, when you go into the Visual Basic Editor (VBE)
    [Tools>Macro>Visual Basic Editor] and look in the Project Window on the left
    side of the screen, you will see something like...
    Sheet2(Info). 'Sheet2' is the REAL name of the worksheet.

    Now, take a look at the REAL sheet name of the worksheet who's name you want
    to keep changing. For this example, let's assume the REAL name is 'Sheet1'
    and the tab name is 'Shmoe'.

    1) Highlight and double-click on the worksheet Sheet1(Shmoe) in the Project
    Window.
    2) In the code window to the right of the Project Window, you will see two
    drop-down boxes. The one on the left will say (General) and the one on the
    right will say (Declarations).
    3) Pull down the (General) drop-down box and choose 'Worksheet'.
    4) Pull down the (Declarations) drop-down box and choose 'Calculate'. Your
    cursor will now be blinking inside a procedure called 'Private Sub
    Worksheet_Calculate()'.
    5) Type the 2 lines...
    On error resume next
    Sheet1.Name = Range("A1").Value

    Now, whenever the sheet is calculated, either automatically or using 'F9',
    'Shmoe' will look in A1 and change it's name to that value.
    Note: It won't work if another worksheet already has the name that you put
    in A1.

    HTH,
    --
    Gary Brown
    gary_brown@ge_NOSPAM.com
    If this post was helpful, please click the ''Yes'' button next to ''Was this
    Post Helpfull to you?''.


    "Jared" wrote:

    > I would like to automatically change a tab's name from cell A1 but the
    > problem starts because cell A1 is in reference from a different sheet so it
    > automatically changes and i don't input it manually. All tries i made worked
    > only manually using the VBA.
    >
    > Cell A1 inputs: =""&Intro!A3&" 7"
    > How can i change Cell "A3" in Sheet "Intro" So the tab's name will change
    > accordingly?
    >
    > Thanks, Jared


  3. #3
    Jared
    Guest

    RE: How to change a tab name with cell reference and formula?

    Absolutly Amazing.

    Thanks so much.

    It worked!!!


    "Gary L Brown" wrote:

    > You're going to have to put some VBA code in the worksheet who's name you
    > want to keep changing.
    >
    > Because you will be changing the name of the worksheet, you obviously can't
    > refer to the worksheet name in your code. BUT, besides the name that you see
    > on the tab, when you go into the Visual Basic Editor (VBE)
    > [Tools>Macro>Visual Basic Editor] and look in the Project Window on the left
    > side of the screen, you will see something like...
    > Sheet2(Info). 'Sheet2' is the REAL name of the worksheet.
    >
    > Now, take a look at the REAL sheet name of the worksheet who's name you want
    > to keep changing. For this example, let's assume the REAL name is 'Sheet1'
    > and the tab name is 'Shmoe'.
    >
    > 1) Highlight and double-click on the worksheet Sheet1(Shmoe) in the Project
    > Window.
    > 2) In the code window to the right of the Project Window, you will see two
    > drop-down boxes. The one on the left will say (General) and the one on the
    > right will say (Declarations).
    > 3) Pull down the (General) drop-down box and choose 'Worksheet'.
    > 4) Pull down the (Declarations) drop-down box and choose 'Calculate'. Your
    > cursor will now be blinking inside a procedure called 'Private Sub
    > Worksheet_Calculate()'.
    > 5) Type the 2 lines...
    > On error resume next
    > Sheet1.Name = Range("A1").Value
    >
    > Now, whenever the sheet is calculated, either automatically or using 'F9',
    > 'Shmoe' will look in A1 and change it's name to that value.
    > Note: It won't work if another worksheet already has the name that you put
    > in A1.
    >
    > HTH,
    > --
    > Gary Brown
    > gary_brown@ge_NOSPAM.com
    > If this post was helpful, please click the ''Yes'' button next to ''Was this
    > Post Helpfull to you?''.
    >
    >
    > "Jared" wrote:
    >
    > > I would like to automatically change a tab's name from cell A1 but the
    > > problem starts because cell A1 is in reference from a different sheet so it
    > > automatically changes and i don't input it manually. All tries i made worked
    > > only manually using the VBA.
    > >
    > > Cell A1 inputs: =""&Intro!A3&" 7"
    > > How can i change Cell "A3" in Sheet "Intro" So the tab's name will change
    > > accordingly?
    > >
    > > Thanks, Jared


  4. #4
    Jared
    Guest

    RE: How to change a tab name with cell reference and formula?

    After trying this out it seemed to me now that every little change that
    happens in the sheet, it starts to caluclate. The problem is that it is too
    much calculation power for the machine. Sometimes the systems crashes of
    overload or it takes more than a while for it to accept input.

    Do you have another way of doing this with a more specific method?
    or actually creating a macro for doing it?

    Thanks again
    Jared

    "Gary L Brown" wrote:

    > You're going to have to put some VBA code in the worksheet who's name you
    > want to keep changing.
    >
    > Because you will be changing the name of the worksheet, you obviously can't
    > refer to the worksheet name in your code. BUT, besides the name that you see
    > on the tab, when you go into the Visual Basic Editor (VBE)
    > [Tools>Macro>Visual Basic Editor] and look in the Project Window on the left
    > side of the screen, you will see something like...
    > Sheet2(Info). 'Sheet2' is the REAL name of the worksheet.
    >
    > Now, take a look at the REAL sheet name of the worksheet who's name you want
    > to keep changing. For this example, let's assume the REAL name is 'Sheet1'
    > and the tab name is 'Shmoe'.
    >
    > 1) Highlight and double-click on the worksheet Sheet1(Shmoe) in the Project
    > Window.
    > 2) In the code window to the right of the Project Window, you will see two
    > drop-down boxes. The one on the left will say (General) and the one on the
    > right will say (Declarations).
    > 3) Pull down the (General) drop-down box and choose 'Worksheet'.
    > 4) Pull down the (Declarations) drop-down box and choose 'Calculate'. Your
    > cursor will now be blinking inside a procedure called 'Private Sub
    > Worksheet_Calculate()'.
    > 5) Type the 2 lines...
    > On error resume next
    > Sheet1.Name = Range("A1").Value
    >
    > Now, whenever the sheet is calculated, either automatically or using 'F9',
    > 'Shmoe' will look in A1 and change it's name to that value.
    > Note: It won't work if another worksheet already has the name that you put
    > in A1.
    >
    > HTH,
    > --
    > Gary Brown
    > gary_brown@ge_NOSPAM.com
    > If this post was helpful, please click the ''Yes'' button next to ''Was this
    > Post Helpfull to you?''.
    >
    >
    > "Jared" wrote:
    >
    > > I would like to automatically change a tab's name from cell A1 but the
    > > problem starts because cell A1 is in reference from a different sheet so it
    > > automatically changes and i don't input it manually. All tries i made worked
    > > only manually using the VBA.
    > >
    > > Cell A1 inputs: =""&Intro!A3&" 7"
    > > How can i change Cell "A3" in Sheet "Intro" So the tab's name will change
    > > accordingly?
    > >
    > > Thanks, Jared


  5. #5
    Registered User
    Join Date
    11-19-2018
    Location
    Sydney, Australia
    MS-Off Ver
    MSO365
    Posts
    1

    Re: How to change a tab name with cell reference and formula?

    8 years later and this post is still solving the same queries.
    Thanks for having put in the effort here, this worked so simply and quickly.


    Quote Originally Posted by Gary L Brown View Post
    You're going to have to put some VBA code in the worksheet who's name you
    want to keep changing.

    Because you will be changing the name of the worksheet, you obviously can't
    refer to the worksheet name in your code. BUT, besides the name that you see
    on the tab, when you go into the Visual Basic Editor (VBE)
    [Tools>Macro>Visual Basic Editor] and look in the Project Window on the left
    side of the screen, you will see something like...
    Sheet2(Info). 'Sheet2' is the REAL name of the worksheet.

    Now, take a look at the REAL sheet name of the worksheet who's name you want
    to keep changing. For this example, let's assume the REAL name is 'Sheet1'
    and the tab name is 'Shmoe'.

    1) Highlight and double-click on the worksheet Sheet1(Shmoe) in the Project
    Window.
    2) In the code window to the right of the Project Window, you will see two
    drop-down boxes. The one on the left will say (General) and the one on the
    right will say (Declarations).
    3) Pull down the (General) drop-down box and choose 'Worksheet'.
    4) Pull down the (Declarations) drop-down box and choose 'Calculate'. Your
    cursor will now be blinking inside a procedure called 'Private Sub
    Worksheet_Calculate()'.
    5) Type the 2 lines...
    On error resume next
    Sheet1.Name = Range("A1").Value

    Now, whenever the sheet is calculated, either automatically or using 'F9',
    'Shmoe' will look in A1 and change it's name to that value.
    Note: It won't work if another worksheet already has the name that you put
    in A1.

    HTH,
    --
    Gary Brown
    If this post was helpful, please click the ''Yes'' button next to ''Was this
    Post Helpfull to you?''.


    "Jared" wrote:

    > I would like to automatically change a tab's name from cell A1 but the
    > problem starts because cell A1 is in reference from a different sheet so it
    > automatically changes and i don't input it manually. All tries i made worked
    > only manually using the VBA.
    >
    > Cell A1 inputs: =""&Intro!A3&" 7"
    > How can i change Cell "A3" in Sheet "Intro" So the tab's name will change
    > accordingly?
    >
    > Thanks, Jared

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,945

    Re: How to change a tab name with cell reference and formula?

    Quote Originally Posted by Iowyn View Post
    8 years later and this post is still solving the same queries.
    Thanks for having put in the effort here, this worked so simply and quickly.
    Thanks for the feedback, always good to see when older posts are still helping
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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