title: Compare data in 2 excel workbooks (unsorted data)
body: <p>i am comparing the data in 2 workbooks, the column headers are in the same order, they are: ID, DepartmentName, Name, SalesAmount, StartDate, End Date.</p>
  
  <p>Currently i am comparing all the cells in sheet 1 to sheet 2 (for example: cell A1 in sheet 1 to cell A1 in sheet 2 ). However, now the data in sheet 2 is in a different order so my current method of comparing will not work.         </p>
  
  <p>If sheet 1 contains the correct data, i want to be able to match the correct rows to sheet 2 and check the data still matches. For the rows that are not present in sheet 2 display a table to notify me of which IDs are missing.</p>
  
  <p>Code which compares cell to cell and identifies differences:</p>
  
  <pre><code>For Each mycell In ActiveWorkbook.Worksheets(shtSheet2).UsedRange
      If Not mycell.Value = ActiveWorkbook.Worksheets(shtSheet1).Cells(mycell.Row, mycell.Column).Value Then        
          mycell.Interior.Color = vbRed
          difference = difference + 1
      End If
  Next
  </code></pre>
  
  <p>Any advice or help will be greatly appreciated! thank you</p>