M
MWE
I have been using VBA for several years. This may be a
really stupid question, but I have recently encountered a
funny phenomena. I use have always assumed that you
could "stack" variables of the same type in a DIM
statement. For example
Dim A, B, C as Integer
and
Dim A as Integer
Dim B as Intger
Dim C as Integer
would have the same effect, i.e., all variables would be
of type Integer.
I now find that this appears to not be true and that some
variables in a multi-variable Dim statement are considered
Variants.
What is supposed to happen with a multi-variable Dim
statement? If only one of the variables is acutallly
types as I want, are the rest of type Variant? What is
the value of allowing multiple variables if they are not
typed the same?
Thanks
really stupid question, but I have recently encountered a
funny phenomena. I use have always assumed that you
could "stack" variables of the same type in a DIM
statement. For example
Dim A, B, C as Integer
and
Dim A as Integer
Dim B as Intger
Dim C as Integer
would have the same effect, i.e., all variables would be
of type Integer.
I now find that this appears to not be true and that some
variables in a multi-variable Dim statement are considered
Variants.
What is supposed to happen with a multi-variable Dim
statement? If only one of the variables is acutallly
types as I want, are the rest of type Variant? What is
the value of allowing multiple variables if they are not
typed the same?
Thanks