ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A macro to color the cells according to the values existing in a c (https://www.excelbanter.com/excel-programming/363288-macro-color-cells-according-values-existing-c.html)

Zancouth

A macro to color the cells according to the values existing in a c
 
Hi,

Does anyone know if it is possible to do a macro that would automatically
color the rows RED( for example ) according to the values in a column ?

E.g. at col B, when the value is IN , the entire row would be colored blue.
when the value is OUT , the entire row would be colored red.




Bob Phillips

A macro to color the cells according to the values existing in a c
 
Use conditional formatting

See http://www.contextures.com/xlCondFormat01.html

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zancouth" wrote in message
...
Hi,

Does anyone know if it is possible to do a macro that would automatically
color the rows RED( for example ) according to the values in a column ?

E.g. at col B, when the value is IN , the entire row would be colored

blue.
when the value is OUT , the entire row would be colored red.






FSt1

A macro to color the cells according to the values existing in a c
 
hi,
yes it is possible but based on your post, conditional formating might be a
better option.
in column B put the following 2 coditions
condition1...if cell value is = "in" set format to blue
condition2...if cell value is = "out" set format to red.
in all the other cell in the rows put the following 2 conditions
condition1...formula is =IF($B2="in",1,0) set format to blue
condition2...formula is =IF($B2="out",1,0) set format to red.

hope this helps
regards
FSt1

"Zancouth" wrote:

Hi,

Does anyone know if it is possible to do a macro that would automatically
color the rows RED( for example ) according to the values in a column ?

E.g. at col B, when the value is IN , the entire row would be colored blue.
when the value is OUT , the entire row would be colored red.





All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com