ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Protect from changing sheet name (https://www.excelbanter.com/excel-discussion-misc-queries/66808-protect-changing-sheet-name.html)

Sloth

Protect from changing sheet name
 
A user can still change the name of a protected sheet. Is there a way to
disable this via coding, or some other option?

Paul B

Protect from changing sheet name
 
Sloth, you could protect the work BOOK
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Sloth" wrote in message
...
A user can still change the name of a protected sheet. Is there a way to
disable this via coding, or some other option?




Sloth

Protect from changing sheet name
 
That is what I currently use, but I really need to lock only the TEMPLATE
sheet. I would like to lock the TEMPLATE sheet and sheet name, but allow for
unlimited acces to all other sheets. I need all other sheet names accesible
because I want them to be able to create and modifie sheets of previous days.
The macro names them according to todays date.


Here's my problem:
I created a file for uneducated users that includes a template sheet. I
programmed a macro that copies the template and renames the copy according to
the date. The template keeps disappearing because one of the users renames
the template and then fills it out for that day. He figured out how to
remove the protection, so I placed a password. Now if he renames the
template sheet, he won't be able to copy it (the macro uses the name TEMPLATE
to copy the sheet), and he won't be able to fill the sheet out either.


"Paul B" wrote:

Sloth, you could protect the work BOOK
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Sloth" wrote in message
...
A user can still change the name of a protected sheet. Is there a way to
disable this via coding, or some other option?





Paul B

Protect from changing sheet name
 
Sloth, maybe put some code like this in the sheet code, right click on the
sheet tab and paste the code in the window that opens

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If ActiveSheet.Name < "TEMPLATE" Then
ActiveSheet.Name = "TEMPLATE"
End If
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Sloth" wrote in message
...
That is what I currently use, but I really need to lock only the TEMPLATE
sheet. I would like to lock the TEMPLATE sheet and sheet name, but allow
for
unlimited acces to all other sheets. I need all other sheet names
accesible
because I want them to be able to create and modifie sheets of previous
days.
The macro names them according to todays date.


Here's my problem:
I created a file for uneducated users that includes a template sheet. I
programmed a macro that copies the template and renames the copy according
to
the date. The template keeps disappearing because one of the users
renames
the template and then fills it out for that day. He figured out how to
remove the protection, so I placed a password. Now if he renames the
template sheet, he won't be able to copy it (the macro uses the name
TEMPLATE
to copy the sheet), and he won't be able to fill the sheet out either.


"Paul B" wrote:

Sloth, you could protect the work BOOK
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Sloth" wrote in message
...
A user can still change the name of a protected sheet. Is there a way
to
disable this via coding, or some other option?







Sloth

Protect from changing sheet name
 
I just hid the sheet. This works just as well. I am still open to any
suggestions.

"Sloth" wrote:

A user can still change the name of a protected sheet. Is there a way to
disable this via coding, or some other option?


Pete

Protect from changing sheet name
 
Hiding is good (until the user discovers that) but you could
password-protect the sheet and only allow copying from your macro. In
your macro you could unprotect the template sheet, copy and rename the
sheet, then protect the template with a password again. If the user
knows how to view macros, then you might have to start
hiding/protecting the code as well.

Hope this helps.

Pete


Sloth

Protect from changing sheet name
 
That's pretty much what I was doing already. The problem is that a protected
sheet (password or not) can still have it's name changed. Hence, the
original question.

I password-protected the template, and then hid it. This allows them to
modify and rearrange all other sheets, which is most important to me. At
this point, if the template is changed at all, it can only be a malicous act.

Also, If I can get Paul's code to work, then I shouldn't have anymore
problems.

"only allow copying from your macro" - is this possible without protecting
the entire workbook?

"Pete" wrote:

Hiding is good (until the user discovers that) but you could
password-protect the sheet and only allow copying from your macro. In
your macro you could unprotect the template sheet, copy and rename the
sheet, then protect the template with a password again. If the user
knows how to view macros, then you might have to start
hiding/protecting the code as well.

Hope this helps.

Pete




All times are GMT +1. The time now is 12:46 AM.

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