View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default Cell Protection vs. Worksheet Protection


kmwhitt wrote:
Is there anyway to protect selected cells from editing without having to
protect the entire worksheet? I know that I can lock or unlock certain cells
when I protect the worksheet as a whole, but when I use worksheet protection,
it interferes with some of my code and user functionality.... Please
advise...

Thanks,

Kevin


Hi Kevin,

Change your code so that it unprotects the sheet, makes its changes,
then protects the sheet.

Eg...

Public Sub CodeForProtection()
With Sheet1
..Unprotect "ken"
..Range("A1").Value = 1
..Protect "ken"
End With
End Sub

If you are not using a password then you just use .Unprotect and
..Protect on their own.

Ken Johnson