title: Excel Worksheet function match doesn't work?
body: <p>I have a date in sheet 'dashboard' M1. and I need to match this in a range in 'HDCinput' cells A33:A833. When I run the below code (part of a bigger macro) I get a "Object variable or With block variable not set". I'm not sure why</p>
  
  <pre><code>Dim mydate As Date
  Dim myrange As Range
  Dim Colindex As Long
  
  mydate = Sheets("Dashboard").Range("M1")
  myrange = Sheets("HDCInput").Range("A3:A833")
  Colindex = Application.WorksheetFunction.Match(mydate, myrange, 0)
  </code></pre>