|
- Sub abc()
- On Error Resume Next
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set d = CreateObject("Scripting.Dictionary")
- With ThisWorkbook.Sheets("662")
- arr = .[A1].Resize(.Cells(Rows.Count, "A").End(xlUp).Row, .Cells(1, Columns.Count).End(xlToLeft).Column)
- End With
- For i = 3 To UBound(arr)
- d(arr(i, 1)) = ""
- Next i
- For Each sht In ThisWorkbook.Sheets
- If d.exists(sht.Name) Then sht.Delete
- Next sht
- For i = 0 To d.Count - 1
- Sheets("模板").Copy after:=Sheets(Sheets.Count)
- With Sheets(Sheets.Count)
- .Name = d.keys()(i)
- End With
- Next i
- Sheet1.Select
- Application.ScreenUpdating = True
- Application.DisplayAlerts = True
-
- End Sub
复制代码 |
|