title: VBA: Break Out of Deeply Nested If Statements
body: <p>Typically when I want to break out of a statement I just set a <code>boolean</code> flag for control flow, but I have a special case with many nested <code>If</code> statements and I'd really like to have a way to break out of several with one simple statement.</p>
  
  <p>In Java you can <a href="https://stackoverflow.com/questions/886955/breaking-out-of-nested-loops-in-java">name a loop</a> and then break to that location; is there anything like that for VBA that can be used from a deeply nested location in <code>If</code> statements? I know VBA has the <a href="http://msdn.microsoft.com/en-us/library/t2at9t47.aspx" rel="nofollow noreferrer">Exit statement</a> for loops (<code>while</code>, <code>for</code>, etc), so I'm wondering if there is something similar for <code>If</code>s.</p>
  
  <p>Ideally I'd like to do something this:</p>
  
  <pre><code>If ...
      *NAMED_IF*
      If ...
           If ...
            :
              *break out of NAMED_IF*
            :
          End If
      End If
      *Now We end up at this control position*
  End If
  </code></pre>