小智 6
最简单的方法是在不满足条件时进行处理.
For i = 3 To num
If Cells(i, 19) <> "" Then
'execute the rest of the processing
End If
Next i
Run Code Online (Sandbox Code Playgroud)
避免i在For Next循环中递增.A GoTo气馁,很大程度上没有必要(如上所述).
如果值是类型值而不是从公式返回,则替换为xlCellTypeConstants的Range.SpecialCells方法中的For Each .