|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub aa()
Dim r%, k%, kk%, m%
Dim d As Object
r = UsedRange.Rows.Count
ar = Range("c1:g1")
Cells.Font.Size = 9
Cells.Interior.ColorIndex = 0
For k = 2 To r
c = Cells(k, Columns.Count).End(xlToLeft).Column
If c > 1 Then
Rng = Range(Cells(k, 1), Cells(k, c))
Set d = CreateObject("scripting.dictionary")
For m = 1 To UBound(Rng, 2)
For kk = 1 To UBound(ar, 2)
If Rng(1, m) = ar(1, kk) Then
d(ar(1, kk)) = ""
With Cells(k, m)
.Font.Size = 35
End With
Exit For
End If
Next kk
Next m
If d.Count = 2 Then'如果二条以上可改成D.COUNT>=2
Rows(k).Interior.Color = RGB(0, 255, 0)
d.RemoveAll
End If
End If
Next k
Set d = Nothing
End Sub
|
|