Hi there how can I set the average of a column equal to a variable. I have this code, but it writes the average in the row after the last row. I just want to set the average equal to the variable for use in a later formula.
Thanks
Thanks
Code:
Dim Averagegearboxspeed
'Determine average angular speed requested of motor
Lastrow = Range("AE65536").End(xlUp).Offset(1, 0).Row
Averagegearboxspeed = "=Average(AE2:AE" & Lastrow - 1 & ")"
Set Averagegearboxspeed = Range("AE" & Lastrow)