Vba protected cells

Solved/Closed
SARC Posts 29 Registration date Saturday August 7, 2010 Status Member Last seen August 31, 2010 - Aug 18, 2010 at 07:37 AM
 SARC - Aug 20, 2010 at 02:23 PM
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 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Aug 18, 2010 at 07:46 AM
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.....
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Aug 20, 2010 at 08:11 AM
I think thats is triggered by

Activesheet.EnableSelection = xlUnlockedCells

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