ub kk()
Dim oNewWorksheet, kj As Worksheet
Application.DisplayAlerts = False
For Each kj In ThisWorkbook.Worksheets
If kj.Name <> "数据" Then
kj.Delete
End If
Next
Application.DisplayAlerts = True
For i = 2 To Worksheets("数据").UsedRange.Rows.Count
If Application.WorksheetFunction.CountIf(Worksheets("数据").Range(Worksheets("数据").Cells(2, 1), Worksheets("数据").Cells(i, 1)), Worksheets("数据").Cells(i, 1).Value) = 1 Then
Set oNewWorksheet = Worksheets.Add
oNewWorksheet.Activate
ActiveSheet.Name = Worksheets("数据").Cells(i, 1).Value
Worksheets("数据").Rows("1:1").Copy
Rows("1:1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
For b = 2 To Worksheets("数据").UsedRange.Rows.Count
If Worksheets("数据").Cells(b, 1).Value = Worksheets("数据").Cells(i, 1).Value Then
Worksheets("数据").Range(Worksheets("数据").Cells(b, 1), Worksheets("数据").Cells(b, 255)).Copy
ActiveSheet.Range("a65536").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End If
Next
End If
[A1].Select
Next
Application.CutCopyMode = False
Application.DisplayAlerts = True
End Sub