title: Application.WorksheetFunction.Match method
body: <p>I have seen a lot of Topics to the "unable to get the match property of the Worksheetfunction class" problem. But I can't get my code fixed.</p>
  
  <p>Why isn't this code work?</p>
  
  <pre><code>rowNum = Application.WorksheetFunction.Match(aNumber, Sheet5.Range("B16:B615"), 0)
  </code></pre>
  
  <p>But a few rows higher this code works:</p>
  
  <pre><code>rowNum2 = Application.WorksheetFunction.Match(originCode, Sheet7.Range("B10:B17"), 0)
  </code></pre>
  
  <p>The only difference between my two lines is that in rowNum2 I used a String for look up and in rowNum a integer.
  Is it possible that the look up Value needs to be a String?</p>
  
  <p>@Update on my Problem</p>
  
  <pre><code>Select Case service
  Case "Low Cost"
  MsgBox Sheet5.Cells(16, "B") 'Gets value 0.5
  Set Rng = Sheet5.Range("B16:B615")
  
     If Not IsError(Application.Match("0.5", Rng, 0)) Then 'But jumps to Else
      rowNum = Application.Match(Weight, Rng, 0) 'Weight = 0.5
      MsgBox rowNum
  Else
      MsgBox "error"
  End If
  
  Case "Standard"
  
  Case "Express"
  
  Case Else
  
  End Select
  </code></pre>
  
  <p>@UPDATE 2</p>
  
  <p>!!! Take care that "0.5" is a String and not 0.5
  So 0.5 is not "0.5" (that was my error in the code)</p>