We help IT Professionals succeed at work.

Excel VBA - what is the maximum length for a statement (single line or broken into multiple lines)?

When you're writing a Excel VBA statement, what is the maximum length for that statement?  I know that you can split one statement line into multiple lines by pressing underscore and space but is there a maximum length for a single statement --single line or multiple?
Watch Question

Most Valuable Expert 2011
Top Expert 2011
I'm not aware of a limit on the length of one physical or logically extended line (there isn't one in the VBA spec, though it does say that an implementation may limit it) - though you should never get near it even if there is one, purely for legibility. The VBIDE seems to not allow more than 1023 characters on one physical line.
There is a limit to the number of line continuation characters you can use (23) and the size of a module (which is basically a function of its text length).


Makes sense.  Thanks!