title: Excel - VBA : loop as long as content of a cell equals specific value
body: <p>I am trying to modify my code to allow more factors to be taken into account when running a loop. Here is what I have so far, it's a loop running for i = 2 to 605 (because between 2 and 605, my <strong>G column's value</strong> is always the same "Makati City").<br>
  <img src="https://i.stack.imgur.com/x70y2.jpg" alt="enter image description here"><br>
  For this loop, I have some actions defined and it's working well. Here is the relevant code showing what my loop is doing :  </p>
  
  <pre><code>For i = 2 To lRowBldg
  Range("B" &amp; i).Activate
  
  'try to find a match btwn active cell and one of the elements from parsed address
      For Each cell In elementsListRange.Cells
        If Match(ActiveCell.Value, cell.Value) Then
          Range("K" &amp; i).Value = Range("K" &amp; i).Value + 13
          Else
          Range("K" &amp; i).Value = Range("K" &amp; i).Value + 0
        End If
        If Match(ActiveCell.Offset(0, 4).Value, cell.Value) Then
        Range("K" &amp; i).Value = Range("K" &amp; i).Value + 8
          Else
          Range("K" &amp; i).Value = Range("K" &amp; i).Value + 0
        End If
      Next
  
  Next i
  </code></pre>
  
  <p>But as I plan to make some modifications to this file, I need to rethink my code. So far, I had only this file for one city so basically I could loop from the first to the last value and it was ok. Now, I plan to add more cities : for example, from 2 to 605 (Makati City), from 606 to 900 (blabla City), from 901 to ... and so on. </p>
  
  <p>What I try to do is something like this :<br>
  "<strong>Loop for as long as the value of the cell in G column is equal to XXXXX (could be Makati City, could be blabla City, whatever)</strong>"<br>
  And if I mention Makati City, it will loop for i = 2 to 605, if it's blabla City, then it will loop for i = 606 to 900, and so on.</p>
  
  <p>Do you have any idea about how to do this in such a way that wouldn't be too resource consuming as my file could end up being very long ?  </p>
  
  <p>Thanks so much in advance !</p>