EXCEL VBA(从显示列最后开始向上查找10行)查找并填充单元颜色
发布网友
发布时间:2022-06-08 11:26
我来回答
共2个回答
热心网友
时间:2023-11-12 16:32
Sub Maqqqq()
Dim k%, i%, j%, Arr$()
Dim Dic As Object
Set Dic = CreateObject("Scripting.Dictionary")
For k = 11 To 55
j = Cells(Rows.Count, k).End(xlUp).Row
Arr = Split(Cells(j, k).Value & "/", "/")
Dic.RemoveAll
For i = 0 To UBound(Arr)
Dic(Arr(i)) = ""
Next i: Dic.Remove ""
For i = j - 1 To j - 11 Step -1
If Dic.Exists(CStr(Cells(i, k).Value)) Then
Cells(i, k).Interior.ColorIndex = 3
Else
Cells(i, k).Interior.ColorIndex = 0
End If
Next i
Next k
Set Dic = Nothing
End Sub
热心网友
时间:2023-11-12 16:33
不需要vba,条件格式即可实现