I am trying to write a simple macro that will select a column in a spread sheet and insert a sum from row2 untill the end of the data. The data is a spread sheet that is provided by someone else and varies in the number of rows.
My code looks like this
I need to select column E
Set r = Range("E")
For n = 2 To r.Rows.Count
ActiveCell.FormulaR1C1(n,5) = "=SUM(RC*1.2)*100"
When I run this I get an error 1004 Method Range of Object _Global failed.
I am not a computer programmer so please keep your answers simple. I would guess from all the help files I have read I am missing something but was unable to understand what.