title: Excel InStr Function opposite direction
body: <p>I have this VBA code that I am using to compare two columns in my Excel spreadsheet, column B to column A.  It then "highlights" the ones that are missing from column A but in column B.</p>
  
  <p>What I can't figure out is how to reverse the procedure to search column B and highlight the ones in column A that are different.</p>
  
  <p>Original Code:</p>
  
  <pre><code>For i = 2 To LastRow
      For j = 2 To LastRow
          If Report.Cells(i, 2).Value &lt;&gt; "" Then 'This will omit blank cells at the end (in the event that the column lengths are not equal.
              If InStr(1, Report.Cells(j, 1).Value, Report.Cells(i, 2).Value, vbTextCompare) &gt; 0 Then
                  Report.Cells(i, 2).Interior.Color = xlNone 'Transparent background
                  Report.Cells(i, 2).Font.Color = RGB(0, 0, 0) 'Black font color
                  Exit For
              Else
                  Report.Cells(i, 2).Interior.Color = RGB(156, 0, 6) 'Dark red background
                  Report.Cells(i, 2).Font.Color = RGB(255, 199, 206) 'Light red font color
              End If
          End If
      Next j
  Next i
  </code></pre>
  
  <p>I have tried renaming the letters and switching the column values and got close but realized that it was using the values from the original search and just highlighting the corresponding cells in column A.</p>