急求高手指点用VB在excel编辑中出现 编译错误,For没有Next 是咋回事

2024-12-23 14:21:41
推荐回答(2个)
回答1:

你的本身就没有啊
For Each objItem In colItems
If colItems <> "00:D0:59:D8:D5:26" Then
Call KillThisWorkbook
Else
ThisWorkbooks.Open.Filename
End If
next '在这加上next 就行了

回答2:

For Each objItem In colItems
If colItems <> "00:D0:59:D8:D5:26" Then
Call KillThisWorkbook
Else
ThisWorkbooks.Open.Filename

End If
next ' 此处少了一个next
End Sub