Can a WorkSheet be proteced from deletion

M

Mike

Is there a way to prevent a user from deleting a given WorkSheet? Also, is
there a way to prevent the user from "UnHiding" a WorkSheet??

Thanks
 
J

JBeaucaire

Sheets hidden manually or hidden with a macro can still be unhidden, password
protecting the hidden sheet might make this harder, but still.

Now a macro that hides a worksheet using the xlVeryHidden flag cannot be
unhidden manually in any way. It can only be unhidden with another macro.

sub HideSheet1()
Sheets("Sheet1").Visible = xlVeryHidden
end sub
 
S

Simon Lloyd

Mike;313562 said:
Is there a way to prevent a user from deleting a given WorkSheet? Also,
is
there a way to prevent the user from "UnHiding" a WorkSheet??

ThanksProtecting the workbook structure should prevent sheet deletion.


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
 
M

Mike

Thanks JB. Works great. Just what I wanted.


JBeaucaire said:
Sheets hidden manually or hidden with a macro can still be unhidden,
password
protecting the hidden sheet might make this harder, but still.

Now a macro that hides a worksheet using the xlVeryHidden flag cannot be
unhidden manually in any way. It can only be unhidden with another macro.

sub HideSheet1()
Sheets("Sheet1").Visible = xlVeryHidden
end sub
 
M

Mike

Thanks Simon. I kept thinking Protect Sheet rather than Protect WorkBook.
Works great.
 
A

AnimalMagic

Is there a way to prevent a user from deleting a given WorkSheet? Also, is
there a way to prevent the user from "UnHiding" a WorkSheet??

Thanks
Right click on the worksheet name tab and select protect. Then use a
password that your user does not know. To prevent unhiding, protect the
entire workbook.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top