VBA compile error with Split Text Function

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top