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.
Not exactly. The OP had posted this...
Dim KK(1 to 10) as double
You responded with this (note the parentheses on kk)...
The OP then asked...
Is there a reason it has to be declared as a variant
To which I attempted to respond that the Variant (as opposed to any specific
data type such as Long) was required by the Array function and then I used
this example as a demonstration (note there are no parentheses on V) to show
that the Array function can return non-homogeneous data types requiring a
Variant to receive them...
Dim V As Variant
V = Array(123, "Text String", Range("A1"))
I think it is at this stage that I introduced some confusion into the
discussion. The interchangeability of these declarations...
Dim V As Variant
Dim V() As Variant
when what is being assigned to V is an array (the output from an Array
function being one such source) is clear in my own head and I never gave a
second thought that it might not be to others... I should have mentioned
something about it in my initial posting, but just didn't think to. You
eventually got me to do that, but it was like pulling teeth getting me
there<g>... sorry.
Rick