Use AutoFilter...
Sub test()
Dim e
Application.ScreenUpdating = False
With Sheets("summary").Cells(1).CurrentRegion
.Parent.AutoFilterMode = False
For Each e In Filter(.Parent.Evaluate("transpose(if(countif(offset(" & _
.Columns(3).Address & ",,,row(1:" & .Rows.Count & "))," & _
.Columns(3).Address & ")=1," & .Columns(3).Address & ",char(2)))"), Chr(2), 0)
If e <> .Cells(3).Value Then
If Not IsSheetExists(e) Then Sheets.Add(after:=Sheets(Sheets.Count)).Name = e
Sheets(e).Cells.Clear
.AutoFilter 3, e
.Copy Sheets(e).Cells(1)
.AutoFilter
End If
Next
End With
Application.ScreenUpdating = True
End Sub
Function IsSheetExists(ByVal txt As String) As Boolean
On Error Resume Next
IsSheetExists = Len(Sheets(txt).Name)
On Error GoTo 0
End Function
Bookmarks