Thursday, December 03, 2009

Protecting Worksheet Names in Excel!!

If you are developing workbooks for others to use, you may want your worksheets to retain whatever names you give them. Excel normally allows users to change worksheet names, as desired. If you don't want them to change, the only way to prevent it is to lock the workbook. You can take these steps if you are using a version of Excel prior to Excel 2007:

1.Display the Review tab of the ribbon.
2.Click Protect Workbook in the Changes group. Excel displays the Protect Structure and Windows dialog box. (Click here to see a related figure.)
3.Make sure that the Structure check box is selected.
4.Enter a password in the Password box.
5.Click on OK. Excel displays the Confirm Password dialog box, prompting you to reenter the password.
6.Reenter the password and click on OK.

The user can no longer make changes to the names of the worksheet tabs, nor to anything else that affects the structure of the workbook. (For instance, they cannot enter new worksheets or delete existing ones.)

If you want to protect the workbook under the control of a macro, then you can use this code:
ActiveWorkbook.Protect Password:="MyPassword", Structure:=TrueAll you need to do is provide password you want to use in place of the "MyPassword" example.

Source: http://excel2007.tips.net/Pages/T0102_Protecting_Worksheet_Names.html

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory