View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default Code to protect sheet

With a password or not?

These apply a password.

Sub SHEETPROTECT()
ActiveSheet.Protect Password:="justme"
End Sub

Sub SHEETUNPROTECT()
ActiveSheet.Unprotect Password:="justme"
End Sub


Note: if youe users are snoopy, you should lock your VBA Project for viewing.

And be aware that worksheet and workbook protection is easily cracked so
protecting a sheet only prevents accidents.


Gord Dibben Excel MVP

On Wed, 21 Dec 2005 12:42:02 -0800, "Conditional Formatting"
wrote:

what will be the VB code to protect sheet. thnaks