I have a VBA macro in excel that has run fine for a while. I've been making changes with these loops already working and suddenly the code is not compiling:
Compile error: Wend without While
I have tried changing to Do While...Loop loops, but I got the equivalent
Compile error: Loop without Do
Here is the structure of my code:
'This loop is fine
While '(code for evaluation)
'code to run in loop
Wend
While '(more eval code)
'code
While '(eval code)
'code
Wend '<--This is where the compile error occurs
'code
While '(eval code)
'code
Wend
'code
Wend
Does anyone have any idea what could be the issue? (Bonus: Does the indentation of code actually matter?)