RAJESH1960
Banned for repeated rules violations
- Joined
- Mar 26, 2020
- Messages
- 2,313
- Office Version
- 2019
- Platform
- Windows
Hello guys
I am trying to edit JohnnyL's code and add one more level in the sort data but I keep getting an error. Can someone please tell me what am I doing wrong here.?
JohnnyL's code
I tried doing this but I am getting a compile error.
I am trying to edit JohnnyL's code and add one more level in the sort data but I keep getting an error. Can someone please tell me what am I doing wrong here.?
JohnnyL's code
VBA Code:
' RANGE SORTER ... Most important column to least important column 3,6,2
With wsDestination
.Range("A2:O" & .Range("B" & Rows.Count).End(xlUp).Row).Sort _
Key1:=.Range("C2"), Order1:=xlAscending, _
Key2:=.Range("F2"), Order1:=xlAscending, _
Key3:=.Range("B2"), Order1:=xlAscending, Header:=xlNo ' Sort the destination sheet by various columns
End With
Code:
RANGE SORTER ... Most important column to least important column 3,6,2
With wsDestination
.Range("A2:O" & .Range("B" & Rows.Count).End(xlUp).Row).Sort _
Key1:=.Range("C2"), Order1:=xlAscending, _
Key2:=.Range("G2"), Order1:=xlAscending, _
Key3:=.Range("H2"), Order1:=xlAscending, Header:=xlNo ' Sort the destination sheet by various columns
Key4:=.Range("B2"), Order1:=xlAscending, Header:=xlNo ' Sort the destination sheet by various columns
End With