2

If I have an array array2() of a given type, say for example Single, or 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())
0

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Ok, then my question is, how badly will the performance suffer or what will be the effect if I convert all single, integer and double arrays in my program to variants?
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.