title: VBA: Comparing single cells between entire rows
body: <p>I have been working with conditional formatting and I thought how it would look like if replaced with a "manual" comparison in VBA. </p>
  
  <p>Let's say I want to compare cells between Row 1 and Row 2, meaning I compare <code>A1</code> to <code>A2</code>, <code>B1</code> to <code>B2</code> etc. Whenever the value in row 2 is bigger, I want to highlight this in row 2. </p>
  
  <p><a href="https://i.stack.imgur.com/W79op.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W79op.jpg" alt="enter image description here"></a>
  If I don't want to do this with conditional formatting, how do I go about this? Do I have to loop through the cells to compare or is there a way to do it without a loop? With a loop it should look like this: </p>
  
  <pre><code>Option Explicit
  
  Sub Testing()
      Dim ws As Worksheet
      Dim i As Long
      Dim rng As Range
  
      Set ws = ThisWorkbook.ActiveSheet
      Set rng = ws.Range("A2:E2")
  
      For i = 1 To rng.Count
          If ws.Cells(2, i).Value &gt; ws.Cells(1, i).Value Then
              ws.Cells(2, i).Interior.ColorIndex = 44
          End If
      Next
  End Sub
  </code></pre>
  
  <p>Is there a way to use less code to achieve the same result? I'm just wondering if I'm unaware of some smarter, alternative way to go about this. </p>