I wrote this simple sub procedure for Excel VBA. I intentionally used a colon (:) to separate statements. Why doesn't it work?
Sub ConditionInsideLoop()
cb = 0: cd = 1: For ca = 1 To 5: If cd = 1 Then cb = cb + 1: Next
End Sub
The question is mostly theoretical. But it might be practical. For example, when we are using the Immediate window and there is a need to use a simple condition inside a simple loop.