I populate a column with data through a loop. I refer to the column with a variable, y.
For ....
Cells(x, y).Value = Data(z)
x = x + 1
Next
I want to use Excel's built-in Average and Stdev functions to calculate stats at the end of the data in each specific column....but I want to use my variables within the function and I'm confused with the syntax.
Cells(x, y).Select
ActiveCell.Formula = "AVERAGE(y:y)"
This doesn't work because it simply takes the average of column Y and not the column that is represented by the variable y. I've played around moving the quotes and using & before the variables, but it just doesn't seem to work. If anyone could help with the syntax of this statement....or perhaps tell me a different way of going about it.....I would greatly appreciate it.
Thank you,
Neil
For ....
Cells(x, y).Value = Data(z)
x = x + 1
Next
I want to use Excel's built-in Average and Stdev functions to calculate stats at the end of the data in each specific column....but I want to use my variables within the function and I'm confused with the syntax.
Cells(x, y).Select
ActiveCell.Formula = "AVERAGE(y:y)"
This doesn't work because it simply takes the average of column Y and not the column that is represented by the variable y. I've played around moving the quotes and using & before the variables, but it just doesn't seem to work. If anyone could help with the syntax of this statement....or perhaps tell me a different way of going about it.....I would greatly appreciate it.
Thank you,
Neil