title: Excel vba unable to get the Vlookup property
body: <p>I know there are a lot of these questions on here but I can't see what is going wrong.</p>
  
  <p>I have the following code which checks whether a value is in a column in another workbook.</p>
  
  <pre><code>Dim masterWbk As Workbook
  Dim oWbk As Workbook
  Dim RowCount As Integer
  Dim LookupRange As Range
  Dim Exists As Variant
  Dim a As Integer
  Dim i As Integer
  Dim jobnumber As String
  
      RowCount = WorksheetFunction.CountA(Sheets("Sheet1").Range("A1").EntireColumn)
  
      masterWbk.Activate
  
  Set LookupRange = masterWbk.Sheets("Sheet1").Range("C1:C100")
  
      a = 0
  
      For i = 0 To RowCount - 1
  
          jobnumber = oWbk.Sheets("Sheet1").Range("A2").Offset(i, 0).Value
  
        '  On Error GoTo ExistsError:
  
          Exists = Application.WorksheetFunction.VLookup(jobnumber, LookupRange, 1, False)
  </code></pre>
  
  <p>Now the value is definitely in the the lookup range and is formatted the same but the Vlookup just won't work. It works fine as an excel formula.</p>
  
  <p>What have I missed?</p>