protecting the entire worksheet

  • Thread starter Hartmut \(Harry\) Kloppert
  • Start date
H

Hartmut \(Harry\) Kloppert

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
 
P

Per Jessen

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
 
H

Hartmut \(Harry\) Kloppert

Thank you Per, that works perfectly.
(I didn't find anything in the Help-file though)

Harry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top