title: Excel VBA - Macro Runs but has no effect
body: <p>I'm new to Excel VBA and this is my first macro, so please forgive me if I've made a very obvious mistake.  I have the following code to compare to worksheets and, if a match is found, to make a note on one of the sheets.  It runs with no errors, but the changes are not being made.  I can't see where I've gone wrong.  Thanks in advance for the help.</p>
  
  <pre><code>Sub invalid()
  
  Dim i As Integer
  Dim j As Integer
  
  Dim main As Worksheet
  Dim invalid As Worksheet
  
  i = 2
  Set main = ThisWorkbook.Worksheets(1)
  Set invalid = ThisWorkbook.Worksheets(2)
  
  Do
      j = 2
      Do
          If LCase$(invalid.Cells(i, 1).Value) = LCase$(main.Cells(j, 13).Value) Then
              main.Cells(j, 14).Value = "Invalid Email"
          End If
          j = j + 1
      Loop While main.Cells(j, 2) = Not Null
      i = i + 1
  Loop While invalid.Cells(i, 2) = Not Null
  
  
  End Sub
  </code></pre>