Excel VBA exit退出循环
exit for退出for循环,exit do用于退出do 或 do while循环:
'获取非空行
Function GetNotNullRow(ByVal iStartRow, ByRef iRow)
Dim Rng As Range
For Each Rng In Range(“B” & iStartRow & “:” & “P” & 100)
If Rng <> “” Then
iRow = Rng.Row
Exit For
End If
Next
End Function