Good day
I have a dataset arranged in columns. I need to calculate the slope that exists between the data of two columns, and repeat it for subsequent columns. However, the array of y-values remain the same with each calculation, but the array of x values moves 1 column forward after each calculation.
My sub for the first two calculations looks something like this:
Sub slopes()
'
' slopes Macro
'
'
ActiveCell.FormulaR1C1 = "=SLOPE(R[-50]C[-1]:R[-3]C[-1],R[-50]C:R[-3]C)"
Range("C51").Select
ActiveCell.FormulaR1C1 = "=SLOPE(R[-50]C[-2]:R[-3]C[-2],R[-50]C:R[-3]C)"
Range("D51").Select
End Sub
How do I create a loop to automatically repeat this process till the last column? I have attached the excel worksheet if that helps...
Sorry if this is an elementary question - I am still new in the VBA world...
Regards
Brand
Bookmarks