Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Errors in Excel VBasic
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Errors in Excel VBasic
Hi, It wouldn't have run previously with this error because this type of error stops the code compiling so maybe it got accidentally altered. Post your code and someone will help. Mike "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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Errors in Excel VBasic
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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel & MS Query caused compile errors | Excel Programming | |||
Compile Errors with Different versions of Excel | Excel Discussion (Misc queries) | |||
compile errors | Excel Discussion (Misc queries) | |||
Excel 97 Macro Compile Errors | Excel Programming | |||
Compile Errors | Excel Programming |