Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password Protection 1

Status
Not open for further replies.

GovNewbi

Technical User
Jul 14, 2010
83
CA
Is there a way to lock the cells on a worksheet so that the user cannot change anything but still have a macro be able to go in and alter them without having to enter the password?
 
Have a look at all the parameters of the Worksheet.Protect method, eg UserInterfaceOnly

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 



Hi,

You must do these things.

Lock/unlock cells appropriately to your requirements.

Protect the sheet.

In your VB Procedure, if you need to change a locked cell, you must

UNPROTECT the sheet,
do your thing,
PROTECT the sheet.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


PHV,

Thanks for the heads up. Lots more parameters in 2007, including the UserInterfaceOnly.
[purple]
==> *[/purple]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hey Skip - UserInterfaceOnly actually existed prior to 2007 - it didn't persist post saving though so had to be set in code on workbook open

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 



Learn something every day!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Something liek this required in workbook_open event:

sht_Report.Protect Password:="letmein", userinterfaceonly:=True

Protects against user entry but allows code to run as if unprotected...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top