|
参与一下。。。
- Sub ykcbf() '//2024.6.27
- Dim arr, brr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("scripting.dictionary")
- arr = Range("a1").CurrentRegion
- Cells.Interior.ColorIndex = 0
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- d(s) = arr(i, 2)
- Next
- r = Cells(Rows.Count, 4).End(3).Row
- For i = 2 To r
- s = Cells(i, 4)
- If d.exists(s) Then
- If Abs(Cells(i, 5) - d(s)) > 0.01 Then
- Cells(i, 4).Resize(, 2).Cells.Interior.ColorIndex = 3
- End If
- Else
- Cells(i, 4).Resize(, 2).Cells.Interior.ColorIndex = 3
- End If
- Next
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|