我有一个VBA for循环,偶尔会得到一个运行时错误13,我想通过增量i来处理这个错误。
我试图处理错误,但它仍然抛出运行时错误13。
For i = 2 To lastRow
On Error GoTo stringNotFound
strString = (ws.Cells(i, 2).Value) 'get value of cell
' Do other stuff
stringNotFound:
Next i
如何处理它,以便在发生错误时跳过单元格并递增?
发布于 2019-08-14 23:08:54
For i = 2 To lastRow
If IsError(ws.Cells(i, 2)) = False Then
strString = (ws.Cells(i, 2).Value) 'get value of cell
' Do other stuff
End If
Next i
https://stackoverflow.com/questions/57503026
复制相似问题