S
SMS - John Howard
The worksheet formula:
=Frequency(A2:A10,B2:B5) applied to the below sample worksheet works fine
and produces the correct array 1, 2, 4, 2
A B
1 Scores Bins
2 79 70
3 85 79
4 78 89
5 85
6 50
7 81
8 95
9 88
10 97
Yet this VBA Macro;
Dim Frq() As Variant
Sub Freq()
Frq = Evaluate("=Frequency(A2:A10,B2:B5)")
x = UBound(Frq)
ReDim Frq(x)
For c = LBound(Frq) To UBound(Frq)
Debug.Print Frq(c)
Next c
End Sub
produces a null for each element of the For Next Loop.
Can anyone tell me why?
TIA
John Howard
=Frequency(A2:A10,B2:B5) applied to the below sample worksheet works fine
and produces the correct array 1, 2, 4, 2
A B
1 Scores Bins
2 79 70
3 85 79
4 78 89
5 85
6 50
7 81
8 95
9 88
10 97
Yet this VBA Macro;
Dim Frq() As Variant
Sub Freq()
Frq = Evaluate("=Frequency(A2:A10,B2:B5)")
x = UBound(Frq)
ReDim Frq(x)
For c = LBound(Frq) To UBound(Frq)
Debug.Print Frq(c)
Next c
End Sub
produces a null for each element of the For Next Loop.
Can anyone tell me why?
TIA
John Howard