|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
学习各位老师到代码,谢谢!请参考
Sub cxhongse()
Call weimss(Sheet2.Range("bi3:bz3"), 255, 1)
End Sub
Sub cxhuangse()
Call weimss(Sheet2.Range("bi9:br9"), 65535, 2)
End Sub
Sub cxlvse()
Call weimss(Sheet2.Range("bi15:br15"), 5287936, 3)
End Sub
Sub qchu()
Sheet2.Range("B6:AN23").Interior.ColorIndex = 0
End Sub
Sub weimss(bjj As Range, ys, jss) '***
Dim i, j, k As Integer
Dim bj, kb
k = 0
kb = Range("B6:AM23")
For Each bs In Range("B6:AM23")
If bs.Interior.Color = ys Then bs.Interior.PatternColor = xlNone
Next
bj = bjj
For i = 2 To UBound(bj, 2)
If bj(1, i) <> 0 Then
For j = 1 To UBound(kb, 2)
If kb(bj(1, i), j) = bj(1, 1) Then Cells(bj(1, i) + 5, j + 1).Interior.Color = ys: k = k + 1
Next
End If
Next
Choose(jss, Sheet2.[BL4], Sheet2.[BL10], Sheet2.[BL16]) = k
End Sub
|
|