If you are willing to let the macro generate the codes automatically and sequentially, try this macro in the Input_Weeks workbook. You will have to run it only once.
Sub MatchData()
Application.ScreenUpdating = False
Dim desWS As Worksheet, arr1 As Variant, arr2 As Variant, Val As String, ws As Worksheet, LastRow As Long, i As Long
Set desWS = Workbooks("Catalogue_weeks.xlsx").Sheets("Catalogue")
arr2 = desWS.Range("B2", desWS.Range("B" & Rows.Count).End(xlUp)).Value
Set rnglist = CreateObject("Scripting.Dictionary")
For Each ws In Sheets
arr1 = ws.Range("C4", ws.Range("C" & Rows.Count).End(xlUp)).Resize(, 8).Value
For i = 1 To UBound(arr2, 1)
Val = arr2(i, 1)
If Not rnglist.Exists(Val) Then
rnglist.Add Val, Nothing
End If
Next i
For i = 1 To UBound(arr1, 1)
Val = arr1(i, 8)
If Not rnglist.Exists(Val) Then
With desWS
.Cells(.Rows.Count, "B").End(xlUp).Offset(1).Resize(, 8).Value = Array(Val, arr1(i, 1), arr1(i, 2), arr1(i, 3), arr1(i, 4), arr1(i, 5), arr1(i, 6), arr1(i, 7))
.Cells(.Rows.Count, "A").End(xlUp) = Left(.Cells(.Rows.Count, "A").End(xlUp).Offset(-1), 1) & Mid(.Cells(.Rows.Count, "A").End(xlUp).Offset(-1), 2, 9999) + 1
End With
End If
Next i
Next ws
Application.ScreenUpdating = True
End Sub
Bookmarks