Hello,
I have three sets named as ParameterArrrayRange(i) where i=1,2,3.
I want to calculate mean and variance of each set and have a 2*3 table named as "ary_statistics" in excel.
Here is what I've done:
Dim HeaderTitleTotal As Integer
HeaderTitleTotal = 3
Dim HeaderStatisticsTotal As Integer
HeaderStatisticsTotal= 2
Dim BasicStatistics() As Variant
ReDim BasicStatistics(2, HeaderTitleTotal)
Dim ParameterArrrayRange(10) As Range
ReDim ParameterArrayRange(HeaderTitleTotal)
Dim HeaderTitleTotalcount As Integer
Dim headerStatisticsTotalCount As Integer
For HeaderTitleTotalcount = 1 To 3
BasicStatistics(1, HeaderTitleTotalcount) = "=VAR.P(" & ParameterArrrayRange(HeaderTitleTotalcount) & ")"
BasicStatistics(2, HeaderTitleTotalcount) = "=average(" & ParameterArrrayRange(HeaderTitleTotalcount) & ")"
For headerStatisticsTotalCount = 1 To HeaderStatisticsTotal
Range("ary_statistics") = BasicStatistics(headerStatisticsTotalCount, HeaderTitleTotalcount)
Next headerStatisticsTotalCount
Next headerStatisticsTotalCount
But I get a Type mismatch error.
Even when I change it to
BasicStatistics(1, HeaderTitleTotalcount) = 4
it doesn't write anything in my matrix.
Could you please help me with these problems?
Thanks
Bookmarks