Okay if I wanted to make it more advanced (such as having multiple My Upkeep sheets) how should I adjust the macro without having to change "My Upkeep" sheet everytime in macro editor?
Sub Matcher()
Dim x, i As Long, dic As Object
With Worksheets("Upkeep Database")
x = .Range("a2").CurrentRegion
End With
Set dic = CreateObject("scripting.dictionary")
dic.comparemode = 1
With dic
ReDim Z(UBound(x, 2))
For i = 2 To UBound(x, 1)
For j = 2 To UBound(x, 2)
Z(j - 2) = x(i, j)
Next
.Item(Trim$(x(i, 1))) = Z
Next
Application.ScreenUpdating = 0
With Worksheets("My Upkeep")
For Each cell In .Range("A2", .Cells(Rows.Count, "A").End(xlUp))
If dic.exists(CStr(cell.Value)) Then
cell.Offset(, 1).Resize(, UBound(Z)) = dic.Item(CStr(cell))
End If
Next
End With
End With
Application.ScreenUpdating = True
End Sub
Bookmarks