Array CountIf Substitute - Count(Match())

后端 未结 2 1201
遥遥无期
遥遥无期 2021-02-10 08:58

Core Question

How can I perform repeated CountIf()s on a range as efficiently (performance-wise) as possible?


Concerns in Detail

2条回答
  •  清酒与你
    2021-02-10 09:54

    Dim rowin as integer 'this is a counter for the row index
    For rowin = 2 To Sheets("Sheet1").UsedRange.Rows.Count
    Sheets("Sheet1").Range("D" & rowin).Value = WorksheetFunction.CountIf(Range("A:A"), Range("C" & rowin))
    Next
    

提交回复
热议问题