Worksheet Tabs

Mldeuser

Well-known Member
Joined
Dec 27, 2008
Messages
534
Is it possible to lock the tabs so they can not be renamed??

Thanks
Mark
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
hI

Tools>Protection>Protect Workbook. You can apply a password to this too but please note that workbook protection (like worksheet protection) is not terribly robust and will prevent no obstacle to a determined user (but will serve to deter causal users from changing your sheet names).
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Just a thought. Are you requesting this because you use the Sheet names in code and when they are changed, the code errors? If so, you can avoid this by using Index numbers in your code instead of Names. So instead of
Code:
WorkSheets("Mary").Range....
use
Code:
WorkSheet(3).Range... or
Sheet3.Range...
Now it will usually not matter if a user renames a sheet.
lenze
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
An even more secure way would be to use the sheet's code name in code, as the index will potentially change if a user moves a sheet, or deletes/inserts one.

The sheet's code name is the name in the VBE in the Properties Window of the sheet next to the (Name) field (so you can also change it in this window too). Somewhat confusingly, it is also the name that doesn't appear in brackets in the top left Project Window of the VBE for the sheet. If you use that in code, then you won't have to worry about users changing order or sheet names from the user interface (ie Excel itself) as the code name does not change:

Rich (BB code):
'refer to sheets via CodeName:

Sheet2.Range("A2:A10").Formula = "=RAND()"

'text in red above is the code name (as determined from the properties window of the worksheet in question)
 

Mldeuser

Well-known Member
Joined
Dec 27, 2008
Messages
534
Thanks for that bit of information as some of the user do reorder the worksheets.

Mark
 

Watch MrExcel Video

Forum statistics

Threads
1,127,318
Messages
5,623,974
Members
416,002
Latest member
Neshx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top