|
参与一下。。。- Sub ykcbf() '//2024.1.28
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set ws = ThisWorkbook
- Set sh = ws.Sheets("Sheet1")
- For Each sht In Sheets
- If sht.Name <> sh.Name Then sht.Delete
- Next
- p = ThisWorkbook.Path & ""
- f = p & "\汇总.xlsx"
- Set wb = Workbooks.Open(f, 0)
- fn = [{"张三","赵六","周八","吴九","郑十"}]
- For i = 1 To UBound(fn)
- Set sht = ws.Sheets.Add(after:=ws.Sheets(ws.Sheets.Count))
- sht.Name = fn(i)
- wb.Sheets(fn(i)).Cells.Copy sht.[a1]
- Next
- wb.Close 1
- sh.Activate
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|