unProtect some cells on the spreadsheet

S

Souris

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,
 

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