小弟實在不才,上網找了一些跟evaluate相關的說明,還是不清楚""、join、&的用法...
繼sumif後,我嘗試要做countif,不過得到到ary(i)陣列值皆是0。
請問版上大大我要如何修改? 謝謝!!
Sub test()
Dim a, b
Dim d, i&
Dim ary(10)
a = Array("A", "B", "A", "B", "B", "C", "B", "C", "D", "B")
b = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
d = UBound(a)
For i = 0 To d
ary(i) = Evaluate("count({""" & Join(a, """,""") & """}=""" & a(i) _
& """)")
Next
End Sub