I have the following macro that I have been using successfully. When I tried to use it today I received the following error (Compile Error: Wrong number of arguments or invalid property assignment) at Split on the line myarray = Split(Lstring, "-")

I have spent hours researching and tweaking my code but it continues to fail in the same place and I have no idea why since it worked previously.

I am trying to take text from Column C rows and split it at the dashes into a total of 3 columns (C, D, E).

Your help would be greatly appreciated.

Sub Splitstring()

Dim Lstring As String
Dim myarray() As String

For a = 2 To 2500

Lstring = Worksheets("Sheet1").Cells(a, 3).Value
myarray = Split(Lstring, "-")

For I = 0 to UBound(myarray)

Worksheets("Sheet1").cells(a, i + 3).Value = myarray(i)

Next
Next

End Sub