开发者

Dim myArray as data type of another array

开发者 https://www.devze.com 2023-02-15 04:06 出处:网络
If I have an array array2() of a given type, say for example Single, or 开发者_StackOverflow中文版String, or any other type.

If I have an array array2() of a given type, say for example Single, or 开发者_StackOverflow中文版String, or any other type.

How do I define array2() such that it has the same data type as array1()?

something like this:

Dim array2() As TypeName(array1())


How about just Dim array2()? That leaves it as type variant.


declaring everything as variant can introduce a fairly significant performance hit in some situations. you could always try the DataTypeofArray function at this site:

http://www.cpearson.com/excel/vbaarrays.htm

0

精彩评论

暂无评论...
验证码 换一张
取 消