+ Reply to Thread
Results 1 to 9 of 9

Locking Worksheet Names

  1. #1
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Locking Worksheet Names

    I need a macro that will make a protected worksheet's name not to be able to be changed. Thanks.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,777

    Re: Locking Worksheet Names

    Have a look at this link: http://stackoverflow.com/questions/8...e-entire-sheet

  3. #3
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Locking Worksheet Names

    I actually found that and tried it but it did not work.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,777

    Re: Locking Worksheet Names

    I tried it on a dummy sheet and it worked for me. Did you put the code into the worksheet code module?

  5. #5
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Locking Worksheet Names

    yes but i will try again. maybe i did something wrong. This worksheet is protected. Do you think that makes a difference?

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Locking Worksheet Names

    Hi, backyardfun,

    if your VBA Code needs that you should consider to use the worksheets CodeName to work with opposed to the visible name on the worksheet.

    Please Login or Register  to view this content.
    would select the sheet listed by tab as InCome. Assuming the CodeName is Sheet2 for InCome you could use
    Please Login or Register  to view this content.
    as well. You would not need to bother for the displayed name when referring to it.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,777

    Re: Locking Worksheet Names

    Try:
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Locking Worksheet Names

    That is what I am currently trying to do but there are some instances where I can't get it to work and this is my alternative.

  9. #9
    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: Locking Worksheet Names

    Perhaps like this?

    Right click on the sheet tab where you wish to protect tab name then click on "View Code" in the windows that opends paste this code after changing sheet name to your needs.

    Please Login or Register  to view this content.
    Then go to "Developer" tab -> Visual Basic -> Tools ->VBAProjcetProperties and set a password.

    People can still change tab name but as soon as they click on this sheet i.e. sheet gets activated the tab name changes back to the name you specified in macro.

    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. Creating New Worksheet from another Worksheet while locking formulas
    By DataVanMan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 04:15 PM
  2. How to declare variable names depending on worksheet names
    By Dynelor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2008, 08:43 AM
  3. Locking column names
    By pdgood in forum Excel General
    Replies: 8
    Last Post: 07-11-2006, 12:11 PM
  4. Locking a Worksheet
    By at_a_loss in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-24-2006, 02:10 PM
  5. Changing VB Component Names to match Worksheet names using VBE
    By Philip in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2005, 01:06 PM

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