+ Reply to Thread
Results 1 to 4 of 4

Change sheet/tab name in code when sheet is re-named

  1. #1
    Registered User
    Join Date
    10-09-2019
    Location
    China
    MS-Off Ver
    365
    Posts
    19

    Change sheet/tab name in code when sheet is re-named

    Hello all,
    is there any possibility to lookup whether a sheet tab is re-named and change it in the code accordingly automatic?

    E.g. I change the sheet name "LogHistorie" to "example". I don't wanna change all by hand.....

    tabname.JPG

    Thank you already
    Andi

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Change sheet/tab name in code when sheet is re-named

    The best way around this is to use the Sheet CodeName (the one NOT between brackets in the Project window)

    That way it doesn't matter if you change the tabname.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    10-09-2019
    Location
    China
    MS-Off Ver
    365
    Posts
    19

    Re: Change sheet/tab name in code when sheet is re-named

    Got it. Will do so in the future.

    Thank you

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Change sheet/tab name in code when sheet is re-named

    You're welcome and thanks for rep+.

+ 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. [SOLVED] Code change from sheet name to Sheet number
    By hkbhansali in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-21-2018, 08:58 AM
  2. [SOLVED] vba code to add modulable no of named worksheets after the last existing named sheet
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2017, 08:48 AM
  3. Replies: 2
    Last Post: 01-01-2015, 09:38 PM
  4. [SOLVED] Safe workbook dialog but only if certain named sheet change
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2014, 01:39 PM
  5. Expanding code from working on one named sheet to multiple named sheets
    By BryanD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2014, 01:26 PM
  6. preventing dynamic named range to change when cut/paste to other sheet.
    By darksimoon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-15-2012, 07:26 AM
  7. [SOLVED] Code to List Named Ranges for each Sheet not working
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-19-2012, 11:13 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