请选择区域A1:E11,按ALT+F11,在打开的VBA窗口插入模块,将下面的代码复制到模块中,运行代码,就搞定了。 Sub aaa() Selection.Copy Worksheets.Add ActiveSheet.Paste Selection.Sort Key1:=[a1], Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ SortMethod:=xlPinYin, DataOption1:=xlSortNormal Dim n As Long For n = Selection.Rows.Count To 3 Step -1 If Cells(n, 1) <> Cells(n - 1, 1) Then Rows(n).Insert Shift:=xlDown Rows(n).Insert Shift:=xlDown Rows(1).Copy Rows(n + 1) End If Next [a1].Select End Sub