|
|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub ykcbf() '//2025.7.16
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set Sh = ThisWorkbook.Sheets("汇总表")
- For Each sht In Sheets
- If sht.Name = Sh.Name Then GoTo 100
- arr = sht.UsedRange.Value
- For i = 2 To UBound(arr)
- s = Trim(CStr(arr(i, 1)))
- If Len(s) Then
- d(s) = arr(i, 2)
- End If
- Next
- 100:
- Next
- With Sh
- .Columns(1).NumberFormatLocal = "@"
- .[a2].Resize(d.Count, 2) = Application.Transpose(Array(d.keys, d.items))
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|