title: Change row background color depending on cell value vba
body: <p>i want to change the row background color if the date is today ( the dates are in column A starting with A7 ) but it doesn't work. Any help is welcomed. Thank you.</p>
  
  <pre><code>Sub Update_Row_Colors()
     Dim LRow As Integer
     Dim LCell As String
     Dim LColorCells As String
     LRow = 7
     While LRow &lt; 50
        LCell = "A" &amp; LRow
        'Color will changed in columns A to AM
        LColorCells = "A" &amp; LRow &amp; ":" &amp; "AM" &amp; LRow
        Select Case Left(Range(LCell).Value, 6)
           Case Now
              Range(LColorCells).Interior.ColorIndex = 34
              Range(LColorCells).Interior.Pattern = xlSolid
           Case Else
              Rows(LRow &amp; ":" &amp; LRow).Select
              Range(LColorCells).Interior.ColorIndex = xlNone
            End Select
            LRow = LRow + 1
     Wend
  End Sub
  </code></pre>