The Animal
Active Member
- Joined
- May 26, 2011
- Messages
- 449
Hi
I have the below sort which just uses I4:I28 etc as the asending sort what would below look like if I wanted to firstly sort F4:F28 in the order "Active then Inactive then extra" and then sort I4:I28 ascending for below rows
Sub TestSort()
ActiveSheet.Unprotect
Range("4:28").Sort Range("I4:I28"), Order1:=xlAscending, Header:=xlNo
Range("34:37").Sort Range("I34:I37"), Order1:=xlAscending, Header:=xlNo
Range("43:48").Sort Range("I43:I48"), Order1:=xlAscending, Header:=xlNo
Range("54:66").Sort Range("I54:I66"), Order1:=xlAscending, Header:=xlNo
Range("72:97").Sort Range("I72:I97"), Order1:=xlAscending, Header:=xlNo
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowFiltering:=True
End Sub
Any help would be great
Stephen
I have the below sort which just uses I4:I28 etc as the asending sort what would below look like if I wanted to firstly sort F4:F28 in the order "Active then Inactive then extra" and then sort I4:I28 ascending for below rows
Sub TestSort()
ActiveSheet.Unprotect
Range("4:28").Sort Range("I4:I28"), Order1:=xlAscending, Header:=xlNo
Range("34:37").Sort Range("I34:I37"), Order1:=xlAscending, Header:=xlNo
Range("43:48").Sort Range("I43:I48"), Order1:=xlAscending, Header:=xlNo
Range("54:66").Sort Range("I54:I66"), Order1:=xlAscending, Header:=xlNo
Range("72:97").Sort Range("I72:I97"), Order1:=xlAscending, Header:=xlNo
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowFiltering:=True
End Sub
Any help would be great
Stephen
Last edited: