As Mike H said, wouldn't have run earlier if any of those were true then.
Are all of these errors coming from a single routine or from several
different sections of the code? Typically if you have a bunch of nested
loops and ifs, the debugger reports the error as being in the outermost block
even though that may not be true. That is, if you have
Sub testerrors()
Dim X As Integer
For X = 1 To 10
If X = 4 Then
MsgBox "X is 4"
Next
End Sub
will give you a "Next Without For" error indication even though it is really
the End If that is the missing element.
"n250jg" wrote:
> I've been running a macro to sort data in Excel but just recently I'm getting
> Compile errors such as "loop without do" and "next without for" and "block if
> without end if", but obviously that is not the case. This was running fine
> before. Any suggestions?
>
|