title: Excel 2010 index match VBA
body: <p>Tried everything and can't seem to get this. Trying to replace values in Row B (SiteTag) of one worksheet with the proper sitetag from an index match in another worksheet.</p>
  
  <blockquote>
    <p>Worksheet(Site_Visit)
    <strong>SiteTag</strong>
    AL27
    AS26
    GBEM4
    ...</p>
    
    <p>Worksheet(Sites)
    <strong>SiteTag</strong>    <strong>Project Name</strong>
    203AL27    AL27
    203AS26    AS26
    201GBEM4   GBEM4
    ...        ...</p>
  </blockquote>
  
  <p>I need to replace the values SiteTag in Sheets("Site_Visit") with the appropriate SiteTag from Sheets("Sites").</p>
  
  <p>For now I've simply tried to get the code to place the correct index value into a variable in which I'll place as the value for each cell, and run it in a loop. But for the life of me can't get it to get a value. This is what I've tried for the variable (everything has been declared). </p>
  
  <pre><code>ST_Cells2 = Application.WorksheetFunction.Index("Sites!A2:A34", Application.WorksheetFunction.Match("Site_Visit!B2", "Sites!B2:B34", 0), 0)
  </code></pre>
  
  <p>Where "Sites!A2:A34" is the range for the appropriate replacement value
  "Sites_Visit!B2" is the lookup value
  "Sites!B2:B34" is the lookup range</p>
  
  <p>I'm getting a Run Time error <code>'1004' Unable to get the Match property of the WroksheetFunction class</code>. Anyone have any ideas?</p>