编译错误没有行突出显示

我得到一个编译错误:预期的expression式。 没有行突出显示XD

Sub name() Dim arr() As String Dim lastRow As Long c = 2 With ActiveSheet lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = 1 To lastRow arr = Split(.Cells(i, 1), " ") For Each e In arr .Cells(i, c).Value = arr(e) c = c + 1 Next Set arr = Empty Next End With End Sub 

正如@ gtwebb所说,这个名字是主要问题。

还有一些其他的小事我发现会debugging:

 Sub name2() Dim e As Variant Dim lastRow As Long Dim c As Integer Dim arr() As String c = 2 With ActiveSheet lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = 1 To lastRow c = 2 arr = Split(.Cells(i, 1), " ") For Each e In arr .Cells(i, c).Value = e c = c + 1 Next Next End With End Sub 

在这里输入图像描述