Accessing Individual Rows/columns From An Array In Vba

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pinkyrose
    New Member
    • May 2007
    • 1

    Accessing Individual Rows/columns From An Array In Vba

    Hi there,

    i need some help in accessing a the ith row in a NxM array in vba. More specifically i have an NxM array called prices and i want to find the average of each row ,as well as the mean and standard deviation of each column.

    Any hints ?i try using this code which sums the elements in the row and divideds it by the number of columns but it does not work when finding the stdev.

    For i = 0 To NumOfYears - 1
    For j = 0 To NumOfMonths - 1
    YearlySum = YearlySum + Prices(i, j)
    Next j
    YearlyAverage(i ) = YearlySum / NumOfMonths
    YearlySum = 0
    Next i
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    I'm not sure I understand the question. Are you saying that you want, for example, an average for January across all the years?

    Comment

    Working...