title: Compare two cells and run different code based on comparison
body: <p>I would like my code to compare cells using an If statement. When the cells are not equal, I want to run my other code. </p>
  
  <p>It is showing red on my screen when I try to do the Else If statement.</p>
  
  <pre><code>Dim WS1 As Worksheet: Set WS1 = ThisWorkbook.Sheets("Increments")
  Dim WS2 As Worksheet: Set WS2 = ThisWorkbook.Sheets("Output")
  
  Dim LR1 As Long, LR2 As Long, WS1_Cell As Range, WS2_Cell As Range
  
  LR1 = WS1.Range("S" &amp; WS1.Rows.Count).End(xlUp).Row
  LR2 = WS2.Range("H" &amp; WS2.Rows.Count).End(xlUp).Row
  
  For Each WS1_Cell In WS1.Range("S1:S" &amp; LR1)
      For Each WS2_Cell In WS2.Range("H1:H" &amp; LR2)
          Else If WS1_Cell = WS2_Cell Then
              WS2_Cell.Offset(, 5).Value = WS1_Cell.Offset(, 5).Value
                  Next WS2_Cell
  Next WS1_Cell
  
         Else  WS1_Cell &lt;&gt; WS2_Cell Then
  
  Dim wsCopy2 As Worksheet
  Dim wsDest2 As Worksheet
  Dim lCopyLastRow2 As Long
  Dim lDestLastRow2 As Long
  Dim wsCopy As Worksheet
  Dim wsDest As Worksheet
  Dim lCopyLastRow As Long
  Dim lDestLastRow As Long
  
  'Set variables for copy and destination sheets
    Set wsCopy2 = Worksheets("Increments")
    Set wsDest2 = Worksheets("Output")
  
    '1. Find last used row in the copy range based on data in column S
    lCopyLastRow2 = wsCopy2.Cells(wsCopy2.Rows.Count, "S").End(xlUp).Row
  
    '2. Find first blank row in the destination range based on data in column H
    'Offset property moves down 1 row
    lDestLastRow2 = wsDest2.Cells(wsDest2.Rows.Count, "H").End(xlUp).Offset(1).Row
  
    '3. Copy &amp; Paste Data if match not found
    wsCopy2.Range("S3:X" &amp; lCopyLastRow2).COPY
       wsDest2.Range("H" &amp; lDestLastRow2).PasteSpecial xlValues
  
     End If
  </code></pre>