View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default protecting the entire worksheet

Hi Harry

Unprotect the sheet, change the Locked property for the desired cells to
True and reprotect the sheet. To reset just change the Locked property to
False.

'Protect TargetCells
Sheets("Sheet1").Unprotect
Range("TargetCells").Locked = True
Sheets("Sheet1").Protect

Regards,
Per

"Hartmut (Harry) Kloppert" skrev i meddelelsen
...
I'm using Office 2007

Thru VBA-coding I'm protecting my worksheet so that the users
can only select and enter data into certain fields (those fields have
been unchecked for "Locked" in the Format Cells.../Protection).

At a certain event (pushbutton) I would like to have those unprotected
cells also being protected ("no more input allowed") until another
"Reset"-
event/pushbutton opens up those cells again for input.

I didn't find any VBA-Help for such a coding...
Any proposal?

Harry