RE: When is it better to declare a dynamic array as a Variant verses declaring it as a Dynamic Array? Bjorn Tore Olsen Cintra 18.Jun.07 01:58 PM a Web browser General 6.0.2 CF2Windows 2000
When it comes to declaration of variables, I would have to side with you, always declare what is closest to your needs.
...but, in this case the OP has a list of strings that is dynamic in nature.
The "normal" way of doing this would be to:
dim arrList() as string
redim arrList(0 to 3)
arrList(0) = "some value"
However, it is much more clear to do the other way, by declaring
dim arrList as variant
arrList = split("somevalue, morevalues")
In this case I believe the added benefit, memorywise, is so insignificant that I would always choose the second option just for the clarity of my code. Make your code easy to read and maintain first, and then optimize for speed and memory if (and only if) needed.