|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
猜一个- Sub aa()
- Dim ar, i&, d As Object
- Dim sh As Worksheet
- Set d = CreateObject("scripting.dictionary")
- Application.DisplayAlerts = False
- With Sheet1
- ar = .Range(.Cells(2, 1), .Cells(.UsedRange.Rows.Count, 1))
- For i = 1 To UBound(ar)
- If Not d.exists(ar(i, 1)) Then
- d(ar(i, 1)) = ""
- End If
- Next
- End With
- For Each sh In Worksheets
- If Not d.exists(sh.Name) And sh.Name <> "信息" Then
- sh.Delete
- End If
- Next
- Application.DisplayAlerts = True
- Set d = Nothing
- End Sub
复制代码 |
|