I can't get the While/Wend loop to work at all. Even the tiniest possible case, such as below:
Sub TestingWhile()
Dim i As Integer
i = 0
Do While i < 10
i = i + 1
Wend
End Sub
The result of that code is an error message window saying "Compile error: Wend without While".
I found people having this error, but only because they always had some wrong if/else statements. This obviously is not the case. What's going on?
By the way, I'm using Microsoft Visual Basic for Applications 7.1 while in Excel 2013.
EDIT - Question solved. Syntax, beginner mistake: Do While
is closed by Loop
, and While
is closed by Wend