看板 Office 關於我們 聯絡資訊
軟體: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
waiter337: https://i.imgur.com/HEKmxwy.png 01/21 09:20
waiter337: https://i.imgur.com/ZoDtg0S.png 01/21 09:21
home0303: 謝謝W大 我研究看看 01/21 09:50