I have a master file which list each Vendor(col B) and their related code (col C). I need to update a transaction list which many rows that may include the vendor more than once to add this code from master list. The code as is finds the vendor once, updates the code then moves to next vendor. I need it update all rows with same code.
Sub matchList()
Dim w1 As Worksheet, w2 As Worksheet
Dim c As Range, FR As Long
Application.ScreenUpdating = False
Set w1 = Worksheets("Master Vendor List")
Set w2 = Worksheets("Vendor Data")
For Each c In w1.Range("B2", w1.Range("B" & Rows.Count).End(xlUp))
FR = 0
On Error Resume Next
FR = Application.Match(c, w2.Columns(15), 0)
On Error GoTo 0
If FR <> 0 Then w2.Range("AH" & FR).Value = c.Offset(, 1)
Next c
Application.ScreenUpdating = True
End Sub
Sub matchList()
Dim w1 As Worksheet, w2 As Worksheet
Dim c As Range, FR As Long
Application.ScreenUpdating = False
Set w1 = Worksheets("Master Vendor List")
Set w2 = Worksheets("Vendor Data")
For Each c In w1.Range("B2", w1.Range("B" & Rows.Count).End(xlUp))
FR = 0
On Error Resume Next
FR = Application.Match(c, w2.Columns(15), 0)
On Error GoTo 0
If FR <> 0 Then w2.Range("AH" & FR).Value = c.Offset(, 1)
Next c
Application.ScreenUpdating = True
End Sub