title: Unable to get the Lookup property of the WorksheetFunction class
body: <p>Following code:</p>
  
  <pre><code>For i = startRow To startRow + (nRows - 1)    
  Set lookUp = Range(col &amp; i)
  Range("I" &amp; i) = IIf(WorksheetFunction.lookUp(lookUp, Sheets("P&amp;C curves").Columns("A")) = lookUp, 1, 0)
  Range("J" &amp; i) = IIf(WorksheetFunction.lookUp(lookUp, Sheets("G Curve").Columns("A")) = lookUp, 1, 0)      
  Next i
  </code></pre>
  
  <p>In the code, the first time I call <code>WorksheetFunction.lookUp</code> everything works fine, namely it fills the column with 1 where it find something, else it puts a zero, but the second line does not work. I receive the error:</p>
  
  <blockquote>
    <p>Unable to get lookup property of the worksheetfunction class.</p>
  </blockquote>
  
  <p>Why does this happen? If I try to use the same logic directly in the excel sheet it works?</p>
  
  <p>Would really appreciate any help...thanks a lot</p>