Can anyone point put what I am doing wrong here? I want to loop through a few rows on one tab using a worksheet function to return countif and sum values. I'm getting a Method "Range" of object "_Global" failed error when I try to run it. This was working before I tried to add I + 9 to so that I could loop through this.
Code:
For i = 1 To 33
linecount = Application.WorksheetFunction.CountIf(Range("D" & i + 9 & ":BC " & i + 9), ">0")
linesum = Application.WorksheetFunction.Sum(Range("D" & i + 9 & ":BC " & i + 9))
Sheets("Sheet1").cell(i + 1, 2).Value = linecount
Sheets("Sheet1").cell(i + 1, 3).Value = linesum
Next I