J
JSnow
I have a workbook with a macro that sorts rows alphabetically. I've now
shared the workbook and now my macro doesn't work. Here's the macro followed
by the error I'm getting:
Sub ALPHA()
ActiveSheet.Unprotect
Range("B3:H999").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Run-time error ‘1004’: Unprotected method of Worksheet failed
I tried to ignore lines 2 and 6 thinking that the protection codes were the
problem. Now I get the following error:
Sub ALPHA()
' ActiveSheet.Unprotect
Range("B3:H999").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
' ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
I get the following error:
Run-time error ‘1004’: Sort method of Range class failed
Please help me fix this. Thank you.
shared the workbook and now my macro doesn't work. Here's the macro followed
by the error I'm getting:
Sub ALPHA()
ActiveSheet.Unprotect
Range("B3:H999").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Run-time error ‘1004’: Unprotected method of Worksheet failed
I tried to ignore lines 2 and 6 thinking that the protection codes were the
problem. Now I get the following error:
Sub ALPHA()
' ActiveSheet.Unprotect
Range("B3:H999").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
' ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
I get the following error:
Run-time error ‘1004’: Sort method of Range class failed
Please help me fix this. Thank you.