|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.12.19
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- For Each sht In Sheets
- If Val(sht.Name) Then
- arr = sht.UsedRange
- For i = 3 To UBound(arr)
- s = arr(i, 2) & "|" & Val(sht.Name)
- d(s) = arr(i, 4)
- Next
- End If
- Next
- With Sheets("汇总")
- r = .Cells(Rows.Count, 2).End(3).Row
- For j = 4 To 6
- For i = 3 To r
- s = .Cells(i, 3) & "|" & j - 3
- If d.exists(s) Then
- .Cells(i, j).Value = d(s)
- Else
- .Cells(i, j).Value = ""
- End If
- Next
- Next
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|