0

is it possible to code short scripts in Immediate Window in VBA? When I was using for example R or Python I had always open console in which I could easly check how short code is working (for example check the result of For loop if it returns range [a, b] or [a, b)) So for example: can I write

For i = 0 to 5
   Debug.Print i
Next i

and run it without creating new module file/creating extra Sub?

Saguro
  • 103
  • 7

1 Answers1

1

You can put this in the immediate window:

For i = 0 to 5: Debug.Print i : Next i and press enter

It is not possible to have line breaks. But instead use a colon.

Ike
  • 9,580
  • 4
  • 13
  • 29