In the following loop the loop works but it has a logic error that I can't fix. It does the calculations I want but for too many rows not the rows I define. As an example: I am summing up 600+ rows. I want the formula to start at row 20 instead it starts at row 4. I don't wat to redefine the for part of the loop because I have other formulas that I have in this loop. Any help would be appreciated.
Code:
Dim R2 as Double
Dim LR as Double
LR = ActiveSheet.UsedRange.Rows.Count
For R2 = 4 To LR - 1
If R2 > 20 Then Range("U20" & ":" & "U" & R2).Formula = "=SUM(" & Range(Cells(ADH20, "E"), Cells(ADL20, "E")).Address(False, False) & ")/20"
Next R2