Sub test()
With ActiveSheet
r = 2
t = .Cells(r, 2).Value
Do Until t = ""
n = Application.WorksheetFunction.CountIf(.Range("b:b"), .Cells(r, 2))
Sheets.Add
.Range("a1:g1").Copy Range("a1")
.Cells(r, 1).Resize(n, 7).Copy Range("a2")
r = r + n
t = .Cells(r, 3).Value
Loop
End With
End Sub
Sub aa()
For Each st In Worksheets
st.Name = st.[b2]
Next
End Sub
这个怎么改才能行