mac7attack
Technical User
Hello,
I have a have big program that I have discussed here before that errors out now. This is about the 10th run-time error I have gotten. Others were easy to fix and now this one perplexes me.
The loop below runs once then returns "Error 1004: Application-defined or Object-defined error" When debugging, the line it highlights is
Analyzed.Cells(GCount, AnWeelCol) = Analyzed.Cells(i, "C")
All variables, except Analyzed, are integers.
Thanks in advanced,
MAC
I have a have big program that I have discussed here before that errors out now. This is about the 10th run-time error I have gotten. Others were easy to fix and now this one perplexes me.
The loop below runs once then returns "Error 1004: Application-defined or Object-defined error" When debugging, the line it highlights is
Analyzed.Cells(GCount, AnWeelCol) = Analyzed.Cells(i, "C")
All variables, except Analyzed, are integers.
Thanks in advanced,
MAC
Code:
For i = DateCellS To DateCellE Step 1
If (i = 1) Then
Analyzed.Cells(GCount, (AnWeekCol + 1)) = 1
Else
If Analyzed.Cells(i, "C") <> Analyzed.Cells(i - 1, "C") Then
Analyzed.Cells(GCount, (AnWeekCol + 1)) = 1
End If
End If
If Analyzed.Cells(i, "C") = Analyzed.Cells(i + 1, "C") Then
Analyzed.Cells(GCount, (AnWeekCol + 1)) = Analyzed.Cells(GCount, (AnWeekCol + 1)) + 1
Analyzed.Cells(GCount, AnWeekCol) = Analyzed.Cells(i, "C")
Else
If (Analyzed.Cells(i, "C") <> Analyzed.Cells(i + 1, "C")) And (Analyzed.Cells(i, "C") <> Analyzed.Cells(i - 1, "C")) Then
Analyzed.Cells(GCount, (AnWeekCol + 1)) = 1
Analyzed.Cells(GCount, AnWeelCol) = Analyzed.Cells(i, "C")
End If
GCount = GCount + 1
End If
Next i