|
Function COUNTIFZQ(qy As Range, zq, tj, Optional x = 0)
Application.Volatile
arr = qy: ReDim brr(1 To UBound(arr), 1 To 1)
k = Cells(Rows Count, qy.Column).End(4).Row - Application.ThisCell.Row - 1
For i = 1 To UBound(arr)
If i = UBound(arr) - k Then Exit For
If arr(i, 1) = "" Then arr(i, 1) = "#"
If i Mod zq = 1 Then j = j + 1
If arr(i, 1) = tj Then brr(j, 1) = brr(j, 1) + 1
Next
For i = j + x To UBound(arr): brr(i, 1) = "": Next
COUNTIFZQ = brr
End Function
粘贴后,下面这一句还是红色的:
k = Cells(Rows.Count, qy.Column).End(4).Row - Application.ThisCell.Row - 1
|
|