[算表] Excel VBA陣列寫法求教

看板Office作者 (Blue night)時間2年前 (2022/01/21 08:31), 編輯推噓0(003)
留言3則, 2人參與, 2年前最新討論串1/1
軟體:EXCEL 版本:2010 Sub 這筆第幾次出現() '220121當COUNTIF法跑不動時的替代方式 Application.ScreenUpdating = 0 For i = 1 To 1048575 If Cells(1 + i, 3 - 1) = "" Then Exit Sub If Cells(1 + i, 3 - 1) <> Cells(1 + i - 1, 3 - 1) Then Cells(1 + i, 3) = 1 Else Cells(1 + i, 3) = Cells(1 + i - 1, 3) + 1 End If Next Application.ScreenUpdating = 1 End Sub 想請教,如何使用陣列arr的方式改寫上述程式,使執行效率提升。 謝謝。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.136.168.168 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Office/M.1642725064.A.DA6.html

01/21 09:20, 2年前 , 1F

01/21 09:21, 2年前 , 2F

01/21 09:50, 2年前 , 3F
謝謝W大 我研究看看
01/21 09:50, 3F
文章代碼(AID): #1XwVx8sc (Office)