#1
|
|||
|
|||
Code for Changing Cell Backgrounds
Sorry about the trivial title but...
I need to be able to compare to figures in different cells, and if one is larger than the other fill the cell with a red background. Something along the lines of if cell a1 is greater than cell b1 then make a1 red else make cell a1 green I will need to copy the same formula in to other cells too. Thank you. |
#2
|
|||
|
|||
Reference:
sub test() dim rng as range for each rng in range("a1:a5") with rng if .value>.offset(0,1).value then .interior.colorindex = 3 else .interior.colorindex = 4 end if end with next end sub |
#3
|
|||
|
|||
Thanks, but I found the "Conditional Formating" options did exactly what I needed.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Drop down box in a cell | Grapejuice | Excel | 0 | 10-22-2007 07:40 PM |
Changing DataSource | ntfirewall | Mail Merge | 0 | 03-30-2007 06:01 AM |
IRR with Changing Signs | aml480 | Excel | 0 | 03-16-2006 11:27 PM |
FileSaveAs with Code | bsmith | Office | 0 | 01-05-2006 08:43 AM |
Question concerning Backgrounds and fading. | NYCorBUST | PowerPoint | 2 | 12-29-2005 09:05 AM |