VBA如何停止While循环

时间:2015-07-15 08:16:42

标签: excel vba excel-vba

我无法阻止第二个循环。它只是不断增加。如何在VBA中停止While循环?

While Sheets("Temp BU v2").Cells(1, iColCountTempList) <> ""
    If sChooseTemp = Sheets("Temp BU v2").Cells(1, iColCountTempList) Then
        MsgBox "WHOOHOO!"
        While Sheets("Temp BU v2").Cells(iRow, iColCountTempList) <> ""
            If sChooseTempCont = iRow Then
                MsgBox "YEAH!"
                sFinalMail = Sheets("Temp BU v2").Cells(iRow, iColCountTempList)
            Else
                iRow = iRow + 1
            End If
        Wend
    Else
        iColCountTempList = iColCountTempList + 1
    End If
Wend

0 个答案:

没有答案