|
参与一下。。。
- Sub ykcbf() '//2024.12.23
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set sh = ThisWorkbook.Sheets("总表")
- arr = sh.UsedRange
- For i = 3 To UBound(arr)
- For j = 2 To 4
- s = arr(i, 1) & "|" & arr(2, j)
- d(s) = arr(i, j)
- Next
- Next
- ReDim brr(1 To 100000, 1 To 100)
- For Each sht In Sheets
- If sht.Name <> sh.Name Then
- If sht.UsedRange.Count > 1 Then
- arr = sht.UsedRange
- r = sht.Cells(Rows.Count, 1).End(3).Row
- For j = 2 To 4
- For i = 3 To r
- s = arr(i, 1) & "|" & arr(2, j)
- If d.exists(s) Then
- arr(i, j) = d(s)
- End If
- Next
- Next
- sht.UsedRange = arr
- End If
- End If
- Next
- sh.Activate
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|