shorter, faster, Col AA doesn't matter
Sub scode()
Const cl& = 5
Dim a As Variant, q As Variant
Dim rws&, cls&, p&, i&, b As Boolean
Application.ScreenUpdating = False
With Sheets.Add(after:=Sheets("Original"))
Sheets("Original").Cells(1).CurrentRegion.Copy .Cells(1)
Set a = .Cells(1).CurrentRegion
rws = a.Rows.Count
cls = a.Columns.Count
a.Sort a(1, cl), 2, Header:=xlYes
.Name = a(2, cl)
a = a.Resize(rws + 1)
p = 2
For i = p To rws + 1
If a(i, cl) <> a(p, cl) Then
If b Then
Sheets.Add.Name = a(p, cl)
.Cells(p, 1).Resize(i - p, cls).Cut Cells(2, 1)
Sheets("Original").Cells(1).Resize(, cls).Copy Cells(1)
End If
b = True
p = i
End If
Next i
End With
Application.ScreenUpdating = True
End Sub
Bookmarks