title: VBA Range.Find method returns error when text exists
body: <p>I am trying to program a UDF for a Case-sensitive <code>VLOOKUP</code>. The goal is to mimic the <code>VLOOKUP</code> arguments, but to return only if a case-sensitive match is found. This is what I have so far</p>
  <pre><code>Function CaseVLOOKUP(lookup_value As Variant, table_array As Range, col_index_num As Integer, range_lookup As Boolean)
  
  Dim search_col As Range
  Dim return_col As Range
  Dim result As Variant
  Dim row_index As Double
  
  Set return_col = Application.WorksheetFunction.Index(table_array, 0, col_index_num)
  Set search_col = Application.WorksheetFunction.Index(table_array, 0, 1)
  
  row_index = search_col.Find(lookup_value, MatchCase:=True, LookIn:=xlValue).Row
  result = return_col(row_index)
  
  
  'Debug.Print result
  CaseVLOOKUP = result
  
  End Function
  </code></pre>
  <p>However, I get the <code>#VALUE</code> error, even if I see the text exists. The error is in the <code>row_index</code> setting line;</p>
  <p>I know the text should exist in <code>return_col</code>, item 23. In the immediate window, I tried</p>
  <pre><code>?lookup_value=search_col(23)
  </code></pre>
  <p>and this returns <code>True</code>. As far as I understand <code>Range.Find</code>, this should work...
  What am I missing ?</p>