I want to sort 4 columns for my VBA application but it gives me a error like this
"Application defined or object defined error"
this is my source code
Range("A3:X" & lastRow).Select Selection.Sort Key1:=Range("e3"), Order1:=xlAscending, _ Key2:=Range("D3"), Order2:=xlAscending, _ Key3:=Range("c3"), Order3:=xlAscending, _ Key4:=Range("f3"), Order4:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal, DataOption2:=xlSortNormal this is working without the Key4 and Order4 I wonder what is wrong with my codes
Range.Sortmethod only defines three keys (columns).