|
参与一下。。。- Sub ykcbf() '//2024.3.12
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("班级课时")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- End With
- For i = 2 To UBound(arr)
- For j = 2 To UBound(arr, 2)
- S = arr(i, 1) & "|" & arr(1, j)
- d(S) = Val(arr(i, j))
- Next
- Next
- On Error Resume Next
- With Sheets("汇总")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- .Cells.Interior.ColorIndex = 0
- For i = 5 To UBound(arr)
- For j = 2 To UBound(arr, 2)
- If arr(i, j) <> Empty Then
- b = Split(arr(i, j), Chr(10))
- S = arr(i, 1) & "|" & b(0)
- If d.Exists(S) Then
- m = Val(Mid(b(1), 3))
- If m = d(S) Then .Cells(i, j).Interior.ColorIndex = 0
- If m > d(S) Then .Cells(i, j).Interior.ColorIndex = 3
- If m < d(S) Then .Cells(i, j).Interior.ColorIndex = 10
- End If
- End If
- Next
- Next
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|