title: If a cell is empty go to next line in code
body: <p>My VBA script executes the steps, say <strong>A-E</strong>.<br />
  I would like if the last field of <strong>E2 contains nothing</strong>, then only <strong>execute A-D</strong>.</p>
  <p>The <strong>same for D2. If this cell has no content then only A-C</strong> and so on until <strong>A-B</strong> since these are never empty.</p>
  <p>Below is an extract of the script so far for every possibility.</p>
  <pre class="lang-vb prettyprint-override"><code>Sub Variations()
  
  Dim rngAList, rngBList, rngCList, rngDList, rngEList As Range
  Dim rngA, rngB, rngC, rngD, rngE As Range
  Dim strVariationList As String
  
  Set rngAList= Tabelle3.Range(Tabelle3.Range(&quot;B2&quot;), Tabelle3.Range(&quot;B2&quot;).End(xlDown))
  Set rngBList= Tabelle3.Range(Tabelle3.Range(&quot;D2&quot;), Tabelle3.Range(&quot;D2&quot;).End(xlDown))
  Set rngCList= Tabelle3.Range(Tabelle3.Range(&quot;F2&quot;), Tabelle3.Range(&quot;F2&quot;).End(xlDown))
  Set rngDList= Tabelle3.Range(Tabelle3.Range(&quot;G2&quot;), Tabelle3.Range(&quot;G2&quot;).End(xlDown))
  Set rngEList= Tabelle3.Range(Tabelle3.Range(&quot;H2&quot;), Tabelle3.Range(&quot;H2&quot;).End(xlDown))
  
  Tabelle3.Range(&quot;I2&quot;).Select
  
  For Each rngA In rngAList
      For Each rngB In rngBList
          For Each rngC In rngCList
              For Each rngD In rngDList
                  For Each rngE In rngEList
                  
                      ActiveCell = &quot;&quot; &amp; rngA.Value &amp; &quot; &quot; &amp; rngB &amp; &quot; &quot; &amp; rngC &amp; &quot; &quot; &amp; rngD &amp; &quot; &quot; &amp; rngE
                  
                      If strVariationList = &quot;&quot; Then
                          strVariationList = ActiveCell
                      Else
                          strVariationList = strVariationList &amp; &quot;, &quot; &amp; ActiveCell
                      End If
                          ActiveCell.Offset(1, 0).Select
                  
                  Next
              Next
          Next
      Next
  Next
  
  Tabelle3.Range(&quot;J2&quot;).Select
  
  For Each rngA In rngAList
      For Each rngB In rngBList
          For Each rngC In rngCList
              For Each rngD In rngDList
                  
                      ActiveCell = &quot;&quot; &amp; rngA.Value &amp; &quot; &quot; &amp; rngB &amp; &quot; &quot; &amp; rngC &amp; &quot; &quot; &amp; rngD
                  
                      If strVariationList = &quot;&quot; Then
                          strVariationList = ActiveCell
                      Else
                          strVariationList = strVariationList &amp; &quot;, &quot; &amp; ActiveCell
                      End If
                          ActiveCell.Offset(1, 0).Select
                  
              Next
          Next
      Next
  Next
  </code></pre>