title: Unable to get Match property of the WorksheetFunction class
body: <p>What I'm trying to do is based on a Cell <code>oSht_Input.Cells(Rows, 7)</code> , I want to find a match in another Sheet's (periodSheet) Column A, and get the corresponding value based on a given column.</p>
  
  <p>I have tried combining the usage of <code>.Index</code> and <code>.Match</code> to do this. the <code>.Index</code> works for me, however I'm getting and error that says </p>
  
  <blockquote>
    <p>Run-time error '1004': Unable to get the Match property of the WorksheetFunction class.</p>
  </blockquote>
  
  <p>I have also tried doing <code>Application.Match</code> in the codes, but that would return me a <code>#N/A</code> Value instead.</p>
  
  <p>What am I doing wrong? </p>
  
  <p>I'm a little bit confused the usage of <code>Application.Match</code> and <code>Application.WorksheetFunction.Match</code>.</p>
  
  <pre><code>Set oSht_Input = Worksheets(outSheet)
  Set periodSheet = Worksheets("PeriodMetadata")
  lastRow = oSht_Input.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
  
  For Rows = 2 To lastRow
      With Application.WorksheetFunction
          dateCell = oSht_Input.Cells(Rows, 7)
          If rollupDataFile.GroupByPeriod Like "Week*" Then
              If rollupDataFile.GroupByPeriod Like "*Sunday" Then
                  oSht_Input.Cells(Rows, 16).value = .Index(periodSheet.Range("B:H"), .Match(dateCell, periodSheet.Range("A:A"), 0), 1)
              ElseIf rollupDataFile.GroupByPeriod Like "*Monday" Then                    
                  oSht_Input.Cells(Rows, 16).value = .Index(periodSheet.Range("B:H"), .Match(dateCell, periodSheet.Range("A:A"), 0), 2)
  
  .... code continues
  </code></pre>
  
  <p>Edit: Decided to add in a little more context for better clarification based on the initial feedback.</p>
  
  <p><code>dateCell</code> will take in the value of a cell, which is definitely a date value. The  Column A in periodSheet contains EVERY single date from January 1st 2000 to December 31st 2020, essentially covering all possible dates. You can safely assume that the value from the <code>dateCell</code> will be within this range of 20 years.</p>
  
  <p><strong>1.</strong> This is the oSht_Input, where Column G is the date
  <img src="https://i.stack.imgur.com/a6ptj.png" alt="This is the oSht_Input, where Column G is the date"></p>
  
  <p><strong>2.</strong> This is the PeriodMetadata sheet, where I am trying to match to Column A (which contains every single date of year 2000-2020 before finding the value based on the .index function.
  <img src="https://i.stack.imgur.com/Eg5DD.png" alt="This is the PeriodMetadata sheet, where I am trying to match to Column A (which contains every single date of year 2000-2020 before finding the value based on the .index function"></p>