Hi,
Is it vital to record how many times each code is listed, since at the end of the day you appear to be wanting a unique list of codes with their associated total values.
If it were me my preferred approach would be to simply combine all the relevant rows and columns from the stock sheets into the master and then use a Pivot Table to analyse the data and show you summary values, count of codes by file, count of 'Actioned by' by file, and just about any other analysis you want.
That could be done very quickly. The macro below will consolidate the data and do just that
All you then need to do is create a Pivot Table to give you your summary.
Sub ConsolidateFileNames()
Dim stDirectory As String, lCounter As Long, stFolder(2) As String, x As Long, lLastrow As Long
Dim wbMaster As Workbook, wbTemp As Workbook
Dim FSO, ofileItem, oSource
stFolder(0) = "jsy"
stFolder(1) = "gsy"
Set wbMaster = ActiveWorkbook
Set FSO = CreateObject("Scripting.FileSystemObject")
For x = 0 To 1
stDirectory = ActiveWorkbook.Path & "\" & stFolder(x) & "\"
Set oSource = FSO.GetFolder(stDirectory)
Application.DisplayAlerts = False
For Each ofileItem In oSource.Files
lCounter = lCounter + 1
Sheets("Master").Cells(lCounter, 9) = ofileItem.Name
Workbooks.Open Filename:=ofileItem
Set wbTemp = ActiveWorkbook
lLastrow = Range("B" & Rows.Count).End(xlUp).Row
Range("B12:C" & lLastrow & ",F12:F" & lLastrow & ",T12:T" & lLastrow & ",U12:U" & lLastrow).Copy
wbMaster.Sheets("Master").Range("A" & Rows.Count).End(xlUp).Cells(2, 1).PasteSpecial (xlPasteValues)
wbTemp.Close
Application.CutCopyMode = False
Next ofileItem
Next x
Set FSO = Nothing
End Sub
Regards
Bookmarks