Excel 运行时错误13处理-继续循环
我有一个VBA for循环,偶尔会得到一个运行时错误13,我想用增量I来处理 我试图处理该错误,但它仍然抛出运行时错误13Excel 运行时错误13处理-继续循环,excel,vba,Excel,Vba,我有一个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 我如何处理它,以便在发生错误时跳过单元格并递增I Fo
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
我如何处理它,以便在发生错误时跳过单元格并递增I
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