本帖最後由 VBALearner 於 2016-7-31 23:53 編輯
Excel VBA的問題
請問如果我有個一維陣列
裡面有10個數字分別對應陣列(1~10)
假設我今天要排序陣列中數值大到小
那我要如何知道排名前5大數值的原始標籤(就是原本的1~10排序被打亂後 如何呼叫)?
感謝回答- option explicit
- dim total(50) as variant
- for i = 1 to 50
- total(i) = application.worksheetfunction.sum(range(cells(i,1),cells(i,10)))
- next
- sorting....%#$?!
- index of top 20?!
複製代碼 或是有其他更好的方式?! |