I'm attempting in Excel to split an array-item within the array itself, but without any luck at all. I'm wondering whether I will have to redim the array-item, but at the same time I'm not sure if that makes any sense or if it's even possible. One thing i've noticed is that the array-items are of string
type in the array, which I'm also suspecting can be the source of the Type Mismatch
error - this despite the array is Dim
'ed as variant
.
An example can be seen here:
Sub testarr()
Dim arr As Variant, str As String, i As Integer
str = "{test:[{test this here||Can it be split inside the array?}]}"
arr = Split(str, "[{")
For i = LBound(arr) To UBound(arr)
arr(i) = Split(arr(i), "||")
Next i
End Sub
Example of the wished structure of the array: