+ Reply to Thread
Results 1 to 6 of 6

Automatically rename worksheet when specific cell change

  1. #1
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    Automatically rename worksheet when specific cell change

    good afternoon,

    I have the following code to update worksheet name based on cell "PURCH_TERMS"(=B3) which works perfectly i.e if B3 is empty then worksheet keeps original name, as soon as cell B3 is updated, worksheet is automatically renamed.

    However if the user goes back to B3 and modify the data, I got an error message.......would it be possible to automatically update the worksheet name each time the data in B3 change (for info data in B is text and is manually entered or picked from a list)

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    thank you in advance

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Automatically rename worksheet when specific cell change

    Perhaps like this?

    Right click on the sheet you wish to run this code on, click "View Code" and paste code in new window.

    Please Login or Register  to view this content.
    Alf
    Last edited by Alf; 12-18-2015 at 08:03 AM.

  3. #3
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    Re: Automatically rename worksheet when specific cell change

    Well no it rename the worksheet but not "purch" & seller.value & purch_terms.value, it name it "seller" only and when I change the "purch_terms.value" the worksheet name remain "seller".value only.

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Automatically rename worksheet when specific cell change

    Then you just include the other parameters as strings i.e.

    Please Login or Register  to view this content.
    Or you can add the name string from another cell

    Please Login or Register  to view this content.
    Alf

  5. #5
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    Re: Automatically rename worksheet when specific cell change

    it name the worksheet as soon as a value is entered in "b3" (like my code) however I would need if feasible, that if the content of cell "b3" is modified, the worksheet name is updated accordingly.

    ex: if B2= "Y" and B3 = "X" then my worksheet is named PURCH Y X which works perfectly either with my code or yours
    but if I go and change B3 to be B3="C" then I want the name of my worksheet to change to be PURCH Y C

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Automatically rename worksheet when specific cell change

    This code is keyed to chang in cell B3 so perhaps this will give you what you wish for.

    Please Login or Register  to view this content.
    If you change the value in cell B2 nothing happends, if you change the value in cell B3 sheet name gets changed but if you only delete value in B3 sheet name stays the same.

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 07-24-2015, 08:33 AM
  2. [SOLVED] code to automatically change value of a cell from a number to a specific word
    By excel151515 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2014, 02:47 PM
  3. automatically change the data entered into a cell to a specific format
    By aadifede in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-18-2012, 03:34 AM
  4. Worksheet Change - only enact after specific cell changes
    By ando1976 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2012, 03:22 AM
  5. [SOLVED] Worksheet change macro on a change in a specific cell
    By dzuspann in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2012, 04:19 PM
  6. Replies: 5
    Last Post: 05-01-2012, 04:02 PM
  7. [SOLVED] change event on specific cell rather than worksheet
    By frendabrenda1 in forum Excel General
    Replies: 3
    Last Post: 09-20-2005, 10:05 AM

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