I have a series of FOR statements, 20 of them, and an IF statement at the end before the NEXT statements. The whole thing is inside another IF statement. My problem is that the last IF statement will not accept the END IF (the IF, END IF in red). I also note that the second NEXT appears to be outside the IF statement because the indent is wrong. It seems that I can't put the NEXT statements inside an IF statement. Please tell me the correct way to go about this.
Thanks
Thanks
Code:
If flag Then
code
For p0 = 0 To Left(0)
code
For p1 = 0 To Left(1)
code
For p2 = 0 To Left(2)
code
For p3 = 0 To Left(3)
code
continue P4, P5 etc until P19
For p19 = 0 To Left(19)
code
If a < 0 Then
Next
Next
Next
continue until all NEXT
Next
End If
End If