VBA array allowed data types

Viewed 48

Microsoft documentation says that

"You can declare an array to work with a set of values of the same data type."

Does that mean that I can, in fact, declare the array as Variant data type, so in the end I can use the array with multiple types of data?

Dim arr(1 to 3)
arr(1) = "stackoverflow" 'string
arr(2) = 1,000,000.00 'number
arr(3) = dateserial(2020,07,28)

Is that ok? Or it is bad practice?

0 Answers
Related