我想在一個單獨的工作表內排序一個範圍。 不過,我不斷收到這樣的信息:'1004':「排序參考無效。」
'1004': "The sort reference is not valid. Make sure it's within the data you want to sort, and the first Sort By box isn't the same or blank.
我已經檢查的範圍,它們都存在並正常工作。
的代碼如下:提前
Dim EmpBRange As String
EmpBRange = Sheets("EmployeeData").Cells(Cells.Rows.Count, "B").End(xlUp).Row
Worksheets("EmployeeData").Range("K3:K" & EmpBRange).Sort Key1:=Range("K3:K" & EmpBRange), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
感謝
謝謝,這很好! – 2013-03-08 16:51:36
哇!你如何看待這些事情? Excel文檔絕對沒有任何有用的信息。 – DavidHyogo 2014-08-15 15:02:15
@DavidHyogo,試錯。它的幾年:-)。 – 2014-08-15 19:52:38