if I want to formating some cells by specific rules , how can I do to fulfill it ??

suppose: range("i2") represent some value , like 2.33

and I want some range of value , which < 2.33 , are formating become some color

such as：

if range("b2:F2") < range("i2")

then " match cells " .Interior.ColorIndex = 5

else if range("b2:f2") > range("i2") and range("b2:f2")< range("j2")

then " match cells " .Interior.ColorIndex = 3

else if range("b2:f2") > range("j2") and range("b2:f2") < range("k2")

then " match cells " .Interior.ColorIndex = 1

end if

suppose: range("i2") represent some value , like 2.33

and I want some range of value , which < 2.33 , are formating become some color

such as：

if range("b2:F2") < range("i2")

then " match cells " .Interior.ColorIndex = 5

else if range("b2:f2") > range("i2") and range("b2:f2")< range("j2")

then " match cells " .Interior.ColorIndex = 3

else if range("b2:f2") > range("j2") and range("b2:f2") < range("k2")

then " match cells " .Interior.ColorIndex = 1

end if

Last edited: