I have this code to sort an Excel sheet
'for the ascending order
Range("A14:CB" & lastRow).Sort key1:=Range(Col & "14:" & Col & lastRow), Order1:=xlAscending, Header:=xlNo, key2:=Range("C14:C" & lastRow), Order2:=xlAscending, Header:=xlNo
'for the descending order
Range("A14:CB" & lastRow).Sort key1:=Range(Col & "14:" & Col & lastRow), Order1:=xlDescending, Header:=xlNo, key2:=Range("C14:C" & lastRow), Order2:=xlAscending, Header:=xlNo
This is what I get when I do ascending sort on Col=J
and this is what I get when I do descending sort on Col=J
Both are obviously wrong. Is there any error I am not seeing in the VBA code?