【发布时间】:2012-06-19 14:48:56
【问题描述】:
我正在尝试调整我为 Excel 2007 编写的 xla 加载项,以便在 Excel 2003 中工作。我已对大部分问题进行了排序,但我无法找到对工作表中的字段进行排序的方法。我有需要按创建日期顺序排序的数据行(其值在 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 上工作?
【问题讨论】:
-
您遇到什么错误?什么不起作用?您是否尝试逐步删除某些代码行?
标签: excel vba excel-2003