Average a range within an array
Hi Excel Monkey,
Perhaps try something like:
'=============
Public Sub Tester()
Dim rng As Range
Dim PeriodicAvg As Double
Set rng = Range("PeriodicArray")
PeriodicAvg = Application.Average(rng.Columns(1))
MsgBox PeriodicAvg
End Sub
'<<=============
---
Regards,
Norman
"ExcelMonkey" wrote in message
...
I have a 2D array called PeriodicArray. It is 30 columns wide and 10 rows
deep. I want to average all the data in the first column of the array.
Why
is the code below not working?
PeriodicAvg =
Application.WorksheetFunction.Average(.WorksheetFu nction.Offset(PeriodicArray,
0, 0, 10, 1))
Thanks
EM
|