Hi
Try
Sub test()
Dim a As Variant
Dim d, i
Dim sh As Worksheet
Application.ScreenUpdating = False
d = Sheets("Sheet1").Cells(1, 2)
With CreateObject("scripting.dictionary")
For Each sh In Worksheets
If sh.Name <> "Sheet1" Then
a = sh.Cells(2, 1).CurrentRegion.Value2
For i = 1 To UBound(a)
If a(i, 2) = d Then .Item(a(i, 1) & "#" & a(i, 3)) = .Item(a(i, 1) & "#" & a(i, 3))
Next
End If
Next
Application.DisplayAlerts = False
Sheets("sheet1").Cells(4, 1).Resize(.Count) = Application.Transpose(.keys)
Sheets("sheet1").Cells(4, 1).Resize(.Count).TextToColumns Destination:=Range("A4"), OtherChar:="#", FieldInfo:=Array(Array(2, 1))
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End With
End Sub
Bookmarks