mercredi 20 juillet 2016

Excel VBA: "For" and "If" statement on a single line?

Is it somehow possible in VBA to put a For and If statement in a single line? The closest what I could get is this:

For i = 0 To n: If a = i Then a = b
Next i

If I write:

For i = 0 To n: If a = i Then a = b: Next i

I get the "Next without For" error.

Aucun commentaire:

Enregistrer un commentaire