title: VBA lookup value from column and if matches on other workbook, copy corresponding cell value into other workbook?
body: <p>I have 2 Excel workbooks with the same name but one is opened via a url:</p>
  
  <p>Workbook 54.xlsm</p>
  
  <pre><code>Column A       Column B      Column C
  --------------------------------------    
  01/12/2016     12345         Notes
  03/12/2016     23456         Notes
  01/12/2016     78643         Notes
  03/12/2016     12345         Notes
  </code></pre>
  
  <p>Workbook 54.xlsm </p>
  
  <pre><code>Column A       Column B      Column C
  -------------------------------------    
  01/12/2016     12345         
  03/12/2016     23456         
  01/12/2016     78643         
  03/12/2016     12345         
  </code></pre>
  
  <p>I am trying to open the latest version of Workbook 54 online and essentially want to be able to copy the notes out of column C from the 1st (older) version of Workbook 54 and paste these into the latest version of workbook 54 where the number in column B matches and where the date in column a matches.</p>
  
  <p>Here's my code so far, for some reason what I've put together doesn't seem to do anything.</p>
  
  <pre><code>'Download File - Check URL
  Sub File()
  
      Dim wb As Workbook
      Dim dt As Date
  
      dt = Now
  
      Const sURL As String = "https://intranet-uk.lidl.net/info-centre/docsdb/Document%20Database/08.%20Buying/8.3%20Food%20Specials/Current%20Information/Food%20Specials%20and%20Seasonal%20Depot%20Memos/"
  
      On Error Resume Next
      Application.DisplayAlerts = False
          Set wb = Workbooks.Open(sURL &amp; "Food%20Specials%20Rolling%20Depot%20Memo%2045%20-%2052.xlsm")
      Application.DisplayAlerts = True
      On Error GoTo 0
  
      If wb Is Nothing Then
          Set wb = Workbooks.Open(sURL &amp; "Food%20Specials%20Rolling%20Depot%20Memo%2046%20-%2001.xlsm")
      End If
  
      Set GetCFWorkbook = wb
  
  
  
      Dim Dic As Object, key As Variant, oCell As Range, i&amp;
      Dim w1 As Worksheet, w2 As Worksheet
  
      Set LookupWB = Application.Workbooks("Food Specials Rolling Depot Memo 46 - 01.xlsm")
      Set Dic = CreateObject("Scripting.Dictionary")
      Set w2 = ThisWorkbook.Sheets("Sheet1")
      Set w1 = Workbooks(LookupWB).Sheets("Sheet1")
  
      i = w1.Cells.SpecialCells(xlCellTypeLastCell).Row
  
      For Each oCell In w1.Range("J6:J" &amp; i)
          If Not Dic.exists(oCell.Value) Then
              Dic.Add oCell.Value, oCell.Offset(, -3).Value
          End If
      Next
  
      i = w2.Cells.SpecialCells(xlCellTypeLastCell).Row
  
      For Each oCell In w2.Range("J6:J" &amp; i)
          For Each key In Dic
              If oCell.Value = key Then
                  oCell.Offset(, 2).Value = Dic(key)
              End If
          Next
      Next
  
  
  End Sub
  </code></pre>