将Excel 2007 VBA转换为Excel 2003

我正在尝试修改我为Excel 2007编写的xla外接程序,以便在Excel 2003中工作。我对大部分问题进行了sorting,但是我无法findsorting工作表中的字段的方法。 我有一些数据需要按照创builddate的顺序进行sorting(其值在H列中)。 这是我使用的Excel 2007代码:

'sort issues into descending order Sheets("In Progress").Sort.SortFields.Clear Sheets("In Progress").Sort.SortFields.Add _ Key:=Range("H:H"), _ SortOn:=xlSortOnValues, _ Order:=xlDescending, _ DataOption:=xlSortNormal With Sheets("In Progress").Sort .SetRange Range("A2:M" & rowCount - 1) .Header = xlNo .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With 

任何人都可以帮助我得到这个与Excel 2003的工作?

最好的方法是编写低版本的代码,以便它可以在所有版本中使用。

我会使用这个代码进行sorting,将在所有版本中工作。

 With Sheets("In Progress") .Range("A2:M" & rowCount - 1).Sort Key1:=.Range("A2"), _ Order1:=xlDescending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End With