Private Sub Command1_Click()
'create a variable called mystr
mystr = Text1.Text
'split the text
textsplit = Split(mystr, ",")
'numcom is popoluated with UBound, giving us the total number of pieces of info in the string
numcom = UBound(textsplit)
'replace 8 with 8000, if our string is larger than 8000 characters then take one comma off
If Len(mystr) > 8 Then
numcom = numcom - 1
End If
x = 1
txtvar = 1
'do until x = to the number of commas
Do Until x = numcom
'keep adding to our strvar variable until we hit a comma
strvar = strvar & Mid(mystr, txtvar, 1)
'increase the amount in the string by 1
txtvar = txtvar + 1
'if we've ended on a comma, add one onto our count
If Right(strvar, 1) = "," Then
x = x + 1
End If
Loop
'populate text2 with our new string
Text2.Text = strvar
End Sub