炎炎设计
'自定义函数不是SUB 过程,你如果不是要自定义函数,自己修改一下吧 Function ss(rg, ParamArray n_arr()) As VariantApplication.Volatile '易失函数 Dim nr As Long, nc As Long, n As LongDim i As Long, j As Long, k as long Dim s As LongDim arr If IsMissing(n_arr) Thenss = "条件缺件"Exit FunctionEnd Ifarr = rgnr = UBound(arr, 1)nc = UBound(arr, 2)n = UBound(n_arr) + 1For i = 1 To nr For j = 1 To nc For k = 1 To n If arr(i, j) = n_arr(k - 1) Then s = s + 1 Next Next If n = s Then ss = ss + 1 End If s = 0NextEnd Function