|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.11.14
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set sh = ThisWorkbook.Sheets("WTY")
- ReDim brr(1 To 10000, 1 To 1)
- For Each sht In Sheets
- If sht.Name <> sh.Name Then
- arr = sht.UsedRange
- For i = 2 To UBound(arr)
- s = arr(i, 3)
- If s <> Empty Then
- If Not d.exists(s) Then
- m = m + 1
- d(s) = m
- brr(m, 1) = s
- End If
- End If
- Next
- End If
- Next
- With sh
- .Columns(14) = ""
- .Columns(14).NumberFormatLocal = "@"
- .[n2].Resize(m, 1) = brr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|