The OP was asking (at least the way I read the question(!)) why I used:
Dim V as Variant
instead of
Dim V() as Long 'or variant or whatever.
This explanation:
This is because with the syntax shown, you are assigning an array directly
to a dynamically declared array... the ability to do this was added in
Version 6 of VB/VBA.
seem to disagree with this earlier statement:
The Array function requires it. That is because you can put almost anything
in the argument list to the Array function, as long as you remember what is
what, of course.<g For example...
"Rick Rothstein (MVP -
VB)" wrote:
<<snipped
But my real point to the OP was that some versions allow this syntax:
dim V() as variant
v = array(1,2,"A")
and some versions don't allow it.
This is because with the syntax shown, you are assigning an array directly
to a dynamically declared array... the ability to do this was added in
Version 6 of VB/VBA.
Rick
--
Dave Peterson