ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA compile error with Split Text Function (https://www.excelbanter.com/excel-programming/395419-vba-compile-error-split-text-function.html)

bobm

VBA compile error with Split Text Function
 

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

bobm

VBA compile error with Split Text Function
 
made reference to Microsoft Access library. Resovled.


All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com