To provide some background, I have looked around Stack to try and find a solution to my problem but have come up short.
Using VBA to compare two excel workbooks
excel vba macro to match cells from two different workbooks and copy and paste accordingly
What I am trying to do is identify if the same numbers are presented in two workbooks, "Workbook A" and "Workbook B". If the same data is present in both workbooks, I want to have data from another column, in Workbook B, to auto-populate in a certain column in Workbook A.
The caveat about Workbook B is that the document will live on a SharePoint site.
The column the data lives in Workbook A is B. The same data the column lives in Workbook B is C.
If the numbers are the same in both workbooks, I want to copy the data from column M in Workbook B and put it in column J in Workbook A.
Any help would be greatly appreciated.
This is the only code I have been able to find:
I am not highly skilled with VBA and don't have any code that works yet. The closest code I was able to find is below:
Sub UpdateW2()
Dim w1 As Worksheet, w2 As Worksheet
Dim c As Range, FR As Long
Application.ScreenUpdating = False
Set w1 = Workbooks("4130 Sedgwick Activity Report 03212016_GT.xlsb").Worksheets("4130 Lincoln")
Set w2 = Workbooks("Test_Eaton Absence Detail Report 04-15-2016 (2)_GT.xlsx").Worksheets("Active Locations")
For Each c In w1.Range("B3", w1.Range("J" & Rows.Count).End(xlUp))
FR = 0
On Error Resume Next
FR = Application.Match(c, w2.Columns("A"), 0)
On Error GoTo 0
If FR <> 0 Then w2.Range("M" & FR).Value = c.Offset(, -3)
Next c
Application.ScreenUpdating = True
End Sub