2
我正在嘗試改編我爲Excel 2007編寫的xla加載項,以便在Excel 2003中工作。我對大多數問題進行了排序,但我無法找到一種方法排序表中的字段。我有一些數據行需要按創建日期的順序進行排序(其值在H列中)。這裏是我使用的Excel 2007代碼:將Excel 2007 VBA轉換爲Excel 2003
'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的工作嗎?
你會得到什麼錯誤?什麼不行?你是否試圖逐步刪除一些代碼行? – JMax