In VBA, can I Dim
multiple objects as Integers in a single line in this concise fashion, or does this declare only d
be an Integer?
Dim a, b, c, d As Integer
In VBA, can I Dim
multiple objects as Integers in a single line in this concise fashion, or does this declare only d
be an Integer?
Dim a, b, c, d As Integer
You can test:
The output in the immediate window:
The empty might be slightly confusing, but it makes it clear that only the last is an integer. Using F8 to step though the code, while viewing the results in the Locals Window is even more informative since then the types of a,b,c are explicitly given as Variant/Empty.