title: Excel VBA: Coloring cells under multiple conditions
body: <p>I am currently altering some prewritten code, so I created a test dummyfile. I am experiencing misbehaviours, where I am unable to find the culprit of. First of all here is my sample Excel datasheet:</p>
  
  <pre><code>Issue Date  Maturity    Status  ISIN            Price
  19/01/2018  06/01/2020  Issued  XS2375645421    97
  25/01/2013  01/01/2020  Issued  XS0879579182    88
  12/01/2015  07/01/2020  Issued  XS4158674165    92
  20/01/2018  05/01/2020  Issued  XS5458614653    98
  31/01/2018  03/01/2020  Traded  XS5445656466    87
  06/02/2018  02/01/2020  In Sub  XS1515113535    99
  </code></pre>
  
  <p>Furthermore, you'll find my code used below:</p>
  
  <pre><code>Sub Button1_Click()
  
  
  Dim wb As Workbook
  Dim ws As Worksheet
  Dim count As Integer
  Set wb = ActiveWorkbook
  Set ws = wb.Sheets("Sheet1")
  'if wb is other than the active workbook
  wb.Activate
  ws.Select
  
  
  'Colorizing The ISIN with the following 3 conditions:
  
  '1.) Issue Date &lt;= today
  '2.) Issue Date + 14d &gt; today
  '3.) Price &lt;= 98
  'So in summary the conditions mean that today has to be in between the Issue Date
  'and 14 days after the Issue Date and the price has to be lower than 98
  
  count = 0
  Do While CDate(ws.Cells(2 + count, 1).Value) &lt;= CDate(Now()) And _
  ws.Cells(2 + count, 5).Value &lt;= 98 And _
  CDate(DateAdd("d", 14, ws.Cells(2 + count, 1).Value)) &gt; CDate(Now())
  
  count = count + 1
  
  ws.Range("D" &amp; count + 1).Interior.Color = RGB(250, 50, 50)
  
  Loop
  
  
  
  End Sub
  </code></pre>
  
  <p>The code works partially, the first ISIN value gets colored, however afterwards if not all conditions are met, the loop suddenly stops. If it would continue, the ISIN in row 5 should also be colored, because all conditions are satisfied. See screenshot below:</p>
  
  <p><a href="https://i.stack.imgur.com/AKheL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AKheL.png" alt="enter image description here"></a></p>
  
  <p>Can anyone help me with this problem?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Kind regards</p>