View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Hughes Mike Hughes is offline
external usenet poster
 
Posts: 5
Default Modifying Locked Cells... :-)

blc,

Yes is the simple answer to your question. if you password protect a sheet
you can fleetingly unprotect it using code in the following way

1st collect the new value for a cell by using a text box

Sub Button1_Click()
msg = "Enter new value"
response = InputBox(msg)

worksheets("Sheet1").unprotect password:="yourpassword"
worksheets("Sheet1").cells(10,10).text=response
worksheets("Sheet1").protect password:="yourpassword"

End Sub

In this way the sheet is only fleetingly unprotected. Be warned even the
mildest of attacks will crack security like this

Mike


"blc" wrote in message
...
Hello all,

Quick question: Is there any way to lock or protect cells
so users cannot edit/modify their contents *YET* still be
able to "programatically" edit/modify the contents of
those same locked or protected cells???

Any help would be appreciated...

Thank you in advance,

blc