Vba protected cells

Solved/Closed
Posts
29
Registration date
Saturday August 7, 2010
Status
Member
Last seen
August 31, 2010
-
 SARC -
Hello,

I have used this code to protect sheets and i have made it not to select locked cells but when this code runs i can still select the locked cells,..

inputWks.Protect wsPwd, DrawingObjects:=False, Contents:=True, Scenarios:= _ 
        False, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:= _ 
        True 
   historyWks.Protect wsPwd, DrawingObjects:=False, Contents:=True, Scenarios:= _ 
        False, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:= _ 
        True

can anyone help??

2 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
record the protection action and see what codes it generate. then use it
thanks..

these are the codes i got from recording the protection... but it doesn seem to record the select locked cells action.....
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
I think thats is triggered by

Activesheet.EnableSelection = xlUnlockedCells

These are three values that you can use
xlNoSelection
xlNoRestrictions
xlUnlockedCells
ok.. thanks rizvisa...... this is the action i was missing.................... thanks a lot.... cheers............