Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backgroud color for 1 cell based on a range of cells values schmill Excel Discussion (Misc queries) 3 July 29th 09 02:18 AM
How do I sum up values only in cells that are color filled? TryingExcel Excel Worksheet Functions 7 April 12th 09 03:34 PM
How do I add values fr/ cells with a given fill color (rose)? john Excel Discussion (Misc queries) 1 January 15th 09 11:10 PM
Q: How to color a cell based on values in two cells abcd1234 Excel Programming 17 March 13th 06 02:03 PM
How do I sum color filled cells in Excel with no values or text? Oy! Excel Discussion (Misc queries) 2 March 9th 06 05:59 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"