【发布时间】:2012-03-13 23:19:10
【问题描述】:
当满足内部条件时,我想退出我的for 循环。满足if 条件时,如何退出for 循环?我认为在我的if 语句的末尾有某种退出,但不知道它会如何工作。
Dim i As Long
For i = 1 To 50
Range("B" & i).Select
If Range("B" & i).Value = "Artikel" Then
Dim temp As Long
temp = i
End If
Next i
Range("A1:Z" & temp - 1).EntireRow.Delete Shift:=xlToLeft
【问题讨论】:
-
If [condition] Then Exit For在你的循环中