Array CountIf Substitute - Count(Match())

后端 未结 2 1235
情歌与酒
情歌与酒 2021-02-10 08:51

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:45

    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
    

提交回复
热议问题