Reputation: 75
I have the following code
Sub Test()
Dim path As String
Dim pathSize As Integer
path = "1,45,6,131,13,71,35,141"
pathSize = Split(path, ",").Length
MsgBox (CStr(pathSize))
End Sub
I intended to determine the size of the path by splitting it with delimiter "," to an array containing 1, 45, 6, 131, 13, 71, 35, and 141 and measuring the size of the array. However, when I run this code, I get an error at line
pathSize = Split(path, ",").Length
with error "Object required". What am I doing wrong here?
Upvotes: 0
Views: 895