VBA compile error with Split Text Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I get the error message - 'Compile error: Wrong number of arguments or
invalid property assignment when trying to use the split function in Excel
2003 VBA noted below. I think I am missing a particular reference but not
sure what it is. I got this code as a solution courtesy from this site.

Regards,

bobm

Sub SplitFunction()

Dim txt As String
Dim x As Variant
Dim i As Long

txt = "Bob; Jane; Karen; John"
x = split(txt, "; ")

For i = 0 To UBound(x)
Debug.Print x(i)
Next i

End Sub
 
Back
Top