VBAsorting4列

我想为我的VBA应用程序sorting3列,但它给了我这样的错误

“应用程序定义或对象定义的错误”

这是我的源代码

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 

这是没有Key4和Order4的工作我不知道我的代码有什么问题

我想这会给你以后的东西:

 With ActiveWorkbook.Worksheets(1).Sort ' set this to the relevant book and sheet .SortFields.Clear .SortFields.Add Key:=Range("E3"), Order:=xlAscending .SortFields.Add Key:=Range("D3"), Order:=xlAscending .SortFields.Add Key:=Range("C3"), Order:=xlAscending .SortFields.Add Key:=Range("F3"), Order:=xlAscending .SetRange Range("A3:X" & lastRow) .Apply End With