title: VBA how to skip rows based on condition and stop when a specific number of conditions have been met
body: <p>I'm running a data file for a contest where there are two types of prizes.  The second prize is based on the first, but using VBA, I'm having difficulty skipping rows AND stopping at specific condition (count).</p>
  
  <p>The output looks like this
  <img src="https://i.imgur.com/om2cop4.jpg" alt="Imgur"></p>
  
  <p>There are only 2 available for Prize2 and I want the VBA code to stop it at the 2nd successful Prize2</p>
  
  <p>I've looked at Do Until Loops and For...Next options, but haven't gotten a successful code to stop the Prize 2 list without filling the entire column or getting an error</p>
  
  <p>Below is what I'm using as code to get the table as it is now.  I previously had the code for the first two rows, but if a plant doesn't have Prize 1, then the 2nd Prize2 doesn't show.</p>
  
  <pre><code>'Portion using Prize 1 to determine Prize 2
  Dim LastRowDest As Long
  Sheets("ThisSheet").Select
  LastRowDest = Range("B" &amp; Rows.Count).End(xlUp).Row
  Range("G2:G" &amp; LastRowDest).FormulaR1C1 = "=IF(RC[-1]=""Prize1"",""Prize2"","" "")"
  </code></pre>
  
  <p>This is how the output with two Prize2's available should look
  <img src="https://i.imgur.com/HUf1eJS.jpg" alt="Imgur"></p>