|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
是这样吗?
Sub test()
Dim a, b, c, aa(2), Ra As Range, j%, i%
a = Split("3 01 02 07 08 12 13 18 19 23 24 29 30 34 35 40 45 46", " ")
b = Split("11 03 04 09 10 14 15 20 25 26 31 36 37 41 42 47 48", " ")
c = Split("4 05 06 11 16 17 21 22 27 28 32 33 38 39 43 44 49", " ")
aa(0) = a: aa(1) = b: aa(2) = c
For Each Ra In Range("c1:i18")
For j = 0 To 2
For i = 1 To UBound(aa(j))
If Val(aa(j)(i)) = Ra.Value Then
Ra.Font.ColorIndex = Val(aa(j)(0))
Exit For
End If
Next i
Next j
Next
End Sub |
|