我正在尝试在我的代码中加入excel vba split函数。但是我收到“编译错误,错误的参数数量或无效的属性赋值”。我已经尝试过许多不同的方法,但仍然遇到编译错误。我需要另一个图书馆吗?下面是一个获取错误的简单宏:
Sub testSplit()
Dim txt As String, i As Integer, FullName As Variant
txt = "John Q Public"
FullName = split(txt, " ")
For i = 0 To UBound(FullName)
Cells(1, i + 1).Value = FullName(i)
Next i
End Sub