Give a chance to next code.
It assume data is in sheet "Data"
Option Explicit
Sub SplitData()
Dim ObjDic As Object
Dim F As Range
Dim WS As Worksheet
Dim G
Dim Rng As Range
Dim Temp
Application.ScreenUpdating = False
Set ObjDic = CreateObject("Scripting.Dictionary")
With Sheets("Data")
'------- PREPARE LIST OF SHEETS
For Each F In .Range(.Cells(6, "A"), .Cells(Rows.Count, "A").End(xlUp))
ObjDic.Item(F.Offset(, 2) & "_" & F.Offset(, 4).Value & "_" & F.Offset(, 5).Value) = _
F.Offset(, 2) & "/" & F.Offset(, 4).Value & "/" & F.Offset(, 5).Value
Next F
End With
DDD = ObjDic.keys
'------- DELETE SHEET IF ALREADY EXIST
For Each WS In ActiveWorkbook.Sheets
If (ObjDic.exists(WS.Name)) Then
Application.DisplayAlerts = False
WS.Delete
Application.DisplayAlerts = True
End If
Next WS
'------- CREATE SHEETS
For Each G In ObjDic.keys
Worksheets.Add After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = G
Next G
'------- COPY DATA
With Sheets("Data")
If (.AutoFilterMode) Then .AutoFilterMode = False ' REMOVE AUTOFILTER IF EXIST
Set Rng = .Range("A5", .Range("A5").SpecialCells(xlCellTypeLastCell))
For Each G In ObjDic.keys
Temp = Split(ObjDic.Item(G), "/")
With Rng
Rng.AutoFilter Field:=3, Criteria1:=Temp(0)
Rng.AutoFilter Field:=5, Criteria1:=Temp(1)
Rng.AutoFilter Field:=6, Criteria1:=Temp(2)
.SpecialCells(xlCellTypeVisible).Copy Destination:=Sheets(G).Cells(1, 1)
End With
Next G
End With
Application.ScreenUpdating = True
Bookmarks