|
参与一下。。。
- Sub ykcbf() '//2024.6.13
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set d = CreateObject("Scripting.Dictionary")
- fn = [{"ABC","01","02","03","04"}]
- For i = 1 To UBound(fn)
- d(fn(i)) = ""
- Next
- Set ws = ThisWorkbook
- On Error Resume Next
- Set sht = ws.Worksheets(fn(1))
- sht.Activate
- If Err.Number <> 0 Then
- Set sht = ws.Worksheets.Add(After:=ws.Worksheets(ws.Worksheets.Count))
- sht.Name = fn(1)
- End If
- For Each sht In ws.Sheets
- If Not d.exists(sht.Name) Then
- sht.Delete
- End If
- Next
- ws.Sheets("01").Activate
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|