トップページ(目次)

059.Forを途中で抜ける

<実行前後>
 → 
Sub Forを途中で抜ける()
    
    For 行数 = 1 To 100
    
        If 行数 = 22 Then '22の時
        
            Exit For 'Forを途中で抜ける
        
        End If
    
    Next 行数

    MsgBox 行数 '22で抜けているので22が表示される

End Sub

Copyright © 2021 https://excel3000.web.fc2.com/ All Rights Reserved.
    inserted by FC2 system