I have a For Next Loop that take each cell in a range, selects say 10 below it, performs a calculation on those ten cells and puts the results in the next column. It would for example take cell A1, sum A1-A10 and put the results in B1. It then loops to A2, sums A2- A11 and puts the results in B2. The following code (only excerpt) works fine.
I want to sum UP rather than down. Select cell A20, sum up A20-A10, and put the results in B20. Haven't been able to do it. In the following code the value for E1 would be 10 and is the number of cells selected down from each cell in range.
For Each Rng In Range("LogRd1")
Rng.Select
Selection.Resize((Range("E1").Value), 1).Select
Rng.Offset(, 1).Formula = ((Application.WorksheetFunction.Sum(Selection)) / ((Range ("E1").Value + 0.0001) - (Application.WorksheetFunction.Sum(Selection))))
Next Rng
Any help appreciated. Thanks, Grant