title: Faster VBA VLookup alternative to retrieving data based on a key
body: <p>I am trying to match a large dataset and copy the values from one sheet to another using VBA. I'm currently using Vlookup, but the process is so slow for even the single column that I'm testing with that it is not viable. Is there a more efficient way to match data based on a key? Essentially my data looks like this, where I am trying to copy the 'Data' from Dataset A to B, using the 'Key'</p>
  
  <p>Dataset A:</p>
  
  <pre><code>Key  Data
  123  yes
  231  yes
  435  no
  </code></pre>
  
  <p>Dataset B:</p>
  
  <pre><code>Key  Data
  453  
  231
  </code></pre>
  
  <p>My code currently is as follows:</p>
  
  <pre><code>    Sub copyData()
  
  Dim myLastRow As Long
  Dim backlogSheet As Worksheet
  Dim combinedSheet As Worksheet
  
  Set backlogSheet = Sheets("All SAMs Backlog")
  Set combinedSheet = Sheets("COMBINED")
  myLastRow = backlogSheet.Cells(Rows.Count, "B").End(xlUp).Row
  
  Application.ScreenUpdating = False
  
  For myRow = 3 To myLastRow
  
      curLoc = backlogSheet.Cells(myRow, "C")
  
      searchVal = Range("D" &amp; myRow).Value
  
      statusVal = Application.VLookup(curLoc, combinedSheet.Range("A:B"), 2, False)
  
      'Range("D" &amp; myRow).Cells.Value = testVal
  Next myRow
  
  MsgBox ("done")
  End Sub
  </code></pre>
  
  <p>Any help is appreciated.</p>