Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Option Base 1
Sub Main()
' This sub just demo's how you would call ParseString
Dim NameArr() As String
Dim i As Integer
ParseString "Bill, Jane, Fred, Frank", NameArr
For i = LBound(NameArr) To UBound(NameArr)
Debug.Print NameArr(i)
Next i
End Sub
Sub ParseString(ByVal MyString As String, ByRef Arr() As String)
Dim count As Integer
Dim tmpStr As String
Dim Pos As Integer
count = 0
Pos = InStr(1, MyString, ",", vbTextCompare)
Do While Pos > 0
count = count + 1
ReDim Preserve Arr(count)
Arr(count) = LTrim(Left$(MyString, Pos - 1))
MyString = Mid$(MyString, Pos + 1)
Pos = InStr(1, MyString, ",", vbTextCompare)
Loop
ReDim Preserve Arr(count + 1)
Arr(count + 1) = LTrim(MyString)
End Sub