I noticed that you made use of the code supplied in thread below...
The norm would be a sign of appreciation or acknowledgement if one's code is used...which in this post was not the case...
https://www.excelforum.com/excel-pro...new-sheet.html
This adapted code should solve...
Option Explicit
Sub Copy()
Dim Val, i As Long, ws As String
Application.ScreenUpdating = False
With Sheet1
.Range(.Cells(4, 9), .Cells(Rows.Count, 9)).AdvancedFilter xlFilterCopy, , .Range("P1"), True
With .Range("P1").CurrentRegion: Val = .Value: .Clear: End With
With .Range("A4:L" & .Cells(Rows.Count, "A").End(xlUp).Row)
For i = 2 To UBound(Val)
ws = Val(i, 1)
If Evaluate("ISREF('" & Val(i, 1) & "'!A5)") = False Then Sheets.Add(, Sheets(Sheets.Count)).Name = ws
.AutoFilter 9, Val(i, 1)
.Offset(1).SpecialCells(12).Copy Sheets(ws).Range("A5")
Sheet1.AutoFilterMode = False
Next i
End With
End With
Application.ScreenUpdating = True
MsgBox "Data transfer completed!", vbExclamation, "Status"
End Sub
Bookmarks