Hi Ian, interesting code to write. The following code assumes that your data is in a range named DataTable,the first row contains field names, and your data is in 49 columns.
Hope this is what you need,
Barrie
Sub Extract_Macro()
' Written by Barrie Davidson
Dim UniqueIdRange
Dim CriteriaId
Dim IdNumber As Integer
Dim DataSheet As String
DataSheet = ActiveSheet.Name
UniqueIdRange = "A" & Range("DataTable").Rows.Count
Range("A1:" & UniqueIdRange).AdvancedFilter Action:=xlFilterCopy, CopyToRange:= _
Range("A1").End(xlToRight).Offset(0, 1).Range("A1"), Unique:=True
UniqueIdRange = Range("A1").End(xlToRight).Address
UniqueIdRange = UniqueIdRange & ":" & Range("A1").End(xlToRight).End(xlDown).Address
IdNumber = 2
Do Until IdNumber > Range(UniqueIdRange).Rows.Count
CriteriaId = Range(UniqueIdRange).Range("A" & IdNumber).Value
Range("DataTable").Select
Selection.AutoFilter Field:=1, Criteria1:=CriteriaId
Range("A1:AW" & Range("A1").End(xlDown).Row).Select
Selection.Copy
Sheets.Add
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets(DataSheet).Select
Range("A1").Select
Selection.AutoFilter Field:=1
IdNumber = IdNumber + 1
Loop
End Sub
Thanks Barry. I won't be able to test this until the middle of next week, but I'll let you know the results.
Thanks again,
Ian