I run advanced filter
ProtectSheets
... code
rngA.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"WorkBalance"), CopyToRange:=Worksheets("Work").Range("R1"), Unique:=False
All sheets are protected with this procedure
Sub ProtectSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect , userinterfaceonly:=True
Next ws
End Sub
And when I try to run my code receive the following error message:
"You cannot use this command on a protected sheet"
Why if the sheets are protected with userinterfaceonly:= True, my code gives me above mentioned error?
Thanks.
ProtectSheets
... code
rngA.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"WorkBalance"), CopyToRange:=Worksheets("Work").Range("R1"), Unique:=False
All sheets are protected with this procedure
Sub ProtectSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect , userinterfaceonly:=True
Next ws
End Sub
And when I try to run my code receive the following error message:
"You cannot use this command on a protected sheet"
Why if the sheets are protected with userinterfaceonly:= True, my code gives me above mentioned error?
Thanks.