ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting Worksheet Names (https://www.excelbanter.com/excel-programming/343426-protecting-worksheet-names.html)

hoppermr

Protecting Worksheet Names
 
I would like VBA code to protect a worksheet from being RENAMED - pls don't
confuse this and tell me how to protect a worksheet as I already know that.

My application works so long as users don't go changing sheet names. Can
anyone help me?

Thnx

Norman Jones

Protecting Worksheet Names
 
Hi Hoppermr,

My application works so long as users don't go changing sheet names. Can
anyone help me?


Try changing your code to use the sheet code name instead of the sheet name.
If the user changes the sheet name, the code name remains unaltered.

---
Regards,
Norman



"hoppermr" wrote in message
...
I would like VBA code to protect a worksheet from being RENAMED - pls don't
confuse this and tell me how to protect a worksheet as I already know
that.

My application works so long as users don't go changing sheet names. Can
anyone help me?

Thnx




Arvi Laanemets

Protecting Worksheet Names
 
Hi

Instead protecting worksheet, have you tried to protect workbook structure?
It looks like you need just this!
(ToolsProtectionProtect Workbook, and check 'Structure')


--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )


"hoppermr" wrote in message
...
I would like VBA code to protect a worksheet from being RENAMED - pls don't
confuse this and tell me how to protect a worksheet as I already know
that.

My application works so long as users don't go changing sheet names. Can
anyone help me?

Thnx




Patrick Molloy[_2_]

Protecting Worksheet Names
 
use the sheet object name.
OPen a new workbook, change the tab name of a sheet to say "Data"
Now look in the IDE for the Project Explorer (Ctrl+R). You'll seesomething
like Sheet1(Data)
select it and view the properties window (F4)
in Properties you'll see the property called (name) which is the object
name, eg Sheet1 and you'll see the Name property has a value Data, the
sheet's name.
change t he object's (name) property to say shData

now, in your code, instead of using, for example
WITH Worksheets("Data")
use
WITH shData

It won't matter if your user changes the tab name (sheet name), the object
name can only be changed through the IDE.




"hoppermr" wrote:

I would like VBA code to protect a worksheet from being RENAMED - pls don't
confuse this and tell me how to protect a worksheet as I already know that.

My application works so long as users don't go changing sheet names. Can
anyone help me?

Thnx



All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com