protect a sheet such that it cannot be deleted

S

sam

Can I protect a sheet such that users cannot delete or edit or view it?

Thanks in Advance
 
D

Dave Peterson

Not really.

Any suggestion that you get would rely on worksheet and workbook protection and
those are pretty easy to break.

So if you don't want others to see the data, don't share that data with them in
excel.
 
S

Simon Lloyd

With a little bit of VBA you can make the sheet xlVeryHidden which mean
it cannot be found or unhidden using the toolbar it can only be mad
visible via VBA again, however if you protect the worksheet it cannot b
edited (well locked cells cannot) and if you further protect th
workbook structure the sheet cannot be deleted, anyway in a VBA standar
module add and run this (dont forget to change MySheet for your actua
sheet name

Code
-------------------

Sub HideMySheet(
Sheets("MySheet").Visible=xlVeryHidde
End Su

-------------------

*How to add and run a Macro*1. *Copy* the macro above pressin
the keys *CTRL+C*
2. Open your workbook
3. Press the keys *ALT+F11* to open the Visual Basic Editor
4. Press the keys *ALT+I* to activate the *Insert menu*
5. *Press M* to insert a *Standard Module*
6. *Paste* the code by pressing the keys *CTRL+V*
7. Make any custom changes to the macro if needed at this time.
8. *Save the Macro* by pressing the keys *CTRL+S*
9. Press the keys *ALT+Q* to exit the Editor, and return to Excel.

*To Run the Macro...*
To run the macro from Excel, open the workbook, and press *ALT+F8* t
display the *Run Macro Dialog*. Double Click the macro's name to *Run
it.

sam;418173 said:
Can I protect a sheet such that users cannot delete or edit or view it

Thanks in Advanc

--
Simon Lloy

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

sam

Thanks for your help, In my situation.. I take user inputs from sheet1
through a userform, and those user inputs are stored in sheet2. So I need
them to access Sheet1 only and not sheet2. Hence I want sheet2 to be
protected such that it cannot be edited, viewed or deleted by these users but
me.
 
S

Simon Lloyd

Then the xlVeryHidden will suit your situatio
sam;418303 said:
Thanks for your help, In my situation.. I take user inputs from sheet
through a userform, and those user inputs are stored in sheet2. So
nee
them to access Sheet1 only and not sheet2. Hence I want sheet2 to b
protected such that it cannot be edited, viewed or deleted by thes
users bu
me






Office Discussion' (http://www.thecodecage.com)

--
Simon Lloy

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

Dave Peterson

You can make the sheet visible via the properties window (in the VBE) for that
sheet. You'd want to protect the workbook project, too.

But this workbook protection is easily broken and code to unhide the sheet could
exist in a different workbook's project.
 
Top