Im writing a code but i get the Invalid Next control variable reference error, and i don't know why. this is my code:
Sub Network()
Dim Net(1 To 8) As Double
Dim Total(1 To 8) As Double
Dim i As Integer
For i = 1 To 8
For j = 1 To 5
Net(j) = Worksheets("Summary").Cells((i * 7) + 12, 9).Value
Next i
Next j
For j = 1 To 5
Total(j) = WorksheetFunction.Sum(Net(j))
Next j
For j = 1 To 5
Worksheets("Summary").Cells(73, 8 + j) = Total(j)
Next j
End Sub
hope someone can help me get this error fixed.