title: How to compare columns from two different excel workbooks
body: <p>I have an Excel-Workbook which has two sheets 'Task' and 'Cities'.
  I need to compare the code for validation of records from 'Task' sheet with that one in 'Cities' Sheet.</p>
  
  <p>I am able to do it as follows:</p>
  
  <pre><code>Dim CityString As String
  Dim CityArray() As String
  
  'Get the last row
  'Dim lastRow As Integer
  LastRow = Sheets("Task").UsedRange.Rows.Count
  nLastRowSheet2 = Sheets("Cities").UsedRange.Rows.Count
  
  Dim c As Range
  Dim d As Range
  Dim e As Variant
  
  'Turn screen updating off to speed up macro code.
  'User won't be able to see what the macro is doing, but it will run faster.
  Application.ScreenUpdating = False
  
  For Each c In Worksheets("Task").Range("A2:A" &amp; LastRow)
      CityString = c
      CityArray() = Split(CityString, ";")
      For Each e In CityArray()
          e = Trim(e)
  
          Dim rngFnder As Range
          On Error Resume Next
  
              Set rngFnder = Sheets("Cities").Range("A2:A" &amp; nLastRowSheet2).Find(e)
  
              If rngFnder Is Nothing Then
                  c.Interior.Color = vbRed
              End If
  
          On Error GoTo 0
      Next
  Next
  </code></pre>
  
  <p>Now I have another requirement where I have to do the same from two different workbooks. </p>
  
  <p>('Task' and 'Cities' sheets are on two different Workbooks)</p>
  
  <p>Can anyone tell me; what all changes I have to make to the above code?</p>