percy4
05-05-2009, 03:18 AM
Hi all,
I've got a problem with below code. Autofitler works fine but not the built in sort function. my sheet has no protected cells so I wonder why it dosen't work.
Please help
Best regards
Per
Sub testavsortera()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="test", userinterfaceonly:=True, AllowSorting:=True
ws.EnableAutoFilter = True
'ws.EnableSelection = xlNoRestrictions
ws.Protect
Next ws
End Sub
I've got a problem with below code. Autofitler works fine but not the built in sort function. my sheet has no protected cells so I wonder why it dosen't work.
Please help
Best regards
Per
Sub testavsortera()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="test", userinterfaceonly:=True, AllowSorting:=True
ws.EnableAutoFilter = True
'ws.EnableSelection = xlNoRestrictions
ws.Protect
Next ws
End Sub