|
参与一下。。。
- Sub ykcbf() '//2024.8.13
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set sh = ThisWorkbook.Sheets("Sheet1")
- p = ThisWorkbook.Path
- f = p & "\系统.xlsx"
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets(1)
- arr = .UsedRange
- wb.Close False
- End With
- For i = 3 To UBound(arr)
- If arr(i, 2) <> Empty Then
- s = arr(i, 2) & "|" & arr(i, 3)
- d(s) = arr(i, 4)
- End If
- Next
- With sh
- r = .Cells(Rows.Count, 2).End(3).Row
- .[b3:f1000].Interior.ColorIndex = 0
- For i = 3 To r
- s = .Cells(i, 3) & "|" & .Cells(i, 4)
- If d.exists(s) Then
- .Cells(i, 6) = d(s)
- End If
- If .Cells(i, 5) = .Cells(i, 6) Then
- .Cells(i, 2).Resize(, 5).Interior.ColorIndex = 6
- End If
- Next
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|