Can anyone explain to me why this works:
Dim myArr As Variant `or, myArr()`
myArr = Array("Brian", "Steve", "Dan", "Mark", "Tom")
And this doesn't:
Dim myArr As String
myArr = Array("Brian", "Steve", "Dan", "Mark", "Tom")
I get Run-time error '13': Type mismatch
Arraystatement returns aVariant. Even if you declared a string array (Dim myArr() as String) it wouldn't work.Dim myArr() as Stringand thenmyArr = Split("Brian,Steve,Dan,Mark,Tom", ",").