I have never really used arrays to any degrees. I am trying to create a function to split a string by tabs, but I am struggling to get it to work even with spaces (not even tried tabs yet). I keep getting a type mismatch compile error but I can't see why. Can any advise?
Code:
Public Function SplitStringByTab(strInput As String) As String()
10 On Error GoTo err_SplitStringByTab
Dim arrOutput() As String
Dim i As Integer
'use the split function
20 arrOutput = Split(strInput)
30 For i = LBound(arrOutput) To UBound(arrOutput)
40 Debug.Print i & " = " & arrOutput(i)
50 Next i
60 SplitStringByTab = arrOutput