I populated a dynamic array using the data from a Table specific only on those rows that have a specific value in a specific column. Until this moment no probs. I’m unable though to do operations referred to one entire column (and only that column).
I thought about something like this
Dim arr as variant Dim avg as double Dim i as integer i = InputBox( "The column I want to calculate the average of") avg = Application.Worksheetfunction.Average(arr.column(i))
Is it possible?
All you need is to change “column” to “columns”
avg = Application.Worksheetfunction.Average(arr.columns(i))
another possibility, worse in this case is the code i used was:
avg = application.worksheetfunction.average(application.index(array,0,i)) –