View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Souris Souris is offline
external usenet poster
 
Posts: 107
Default unProtect some cells on the spreadsheet

I have foloing code to let user enter data only in range

dim wsDestination as string

wsDestination = "Mysheet"

Sheets(wsDestination).Select
ActiveSheet.Protection.AllowEditRanges(1).Delete
ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination & " Range
" _ & "G12" , Range:=Range("G12:R36" )
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

I have the code in the loop to unprotect cells in the spreadsheets.

It seems that the code only unprotect the first in the loop or unprotect
nothing.

What I did wrong here?
Any information is great appreciated,