Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Clark Butler   on Jan 04 In MS Office Category.

  
Question Answered By: Roosevelt Jenkins   on Jan 04

I'll address the second question first.
On the sheet  change all of the cells to "unlocked".
Then select the cells you want to protect, and change
the property to "locked".
Now, when you protect  the sheet, be sure to remove the authorization
that says to allow users to select locked cells.
Now, record a macro in which you change  the protection  on the sheet.
The macro record function will not include the password.
What you have to do is something like:
MyPasswd = "testing"

Sheets("Sheet1").Protect _
DrawingObjects:=False, _
Contents:=True, _
Scenarios:=True, _
AllowFormattingCells:=True, _
Password:=MyPasswd
To unprotect, use:
Sheets("Sheet1").Unprotect Password:=MyPasswd
Of course you should password  protect your VBA modules to keep
users from being able to find your hard-coded password!

Share: 

 
 


Tagged: