Coloring condition macro

mikesal57

Board Regular
Joined
Jul 6, 2011
Messages
193
Office Version
  1. 2016
Platform
  1. Windows
HI GUYs ..

Need a macro to do this.......
columns....ac.....ad.....ae.....af......bw.....bx.....by

line 4.........4........3.......2......1......6........2......1
line 5........1........4.......3......5......4........5.......1
line 6.........4........2.......1.......6.....1........2.......4

I have 2 groups (1) ac,ad,ae,af & (2) bw,bx,by

column bw is red color
column bx is green color
column by is blue color

Now if a number in group one matches a number in group 2
then I want the cell to change to that color in group 2 and keep the info inside the cell

examples:
line 4 (ae) will change to color green with the 2 in it
line 4 (af) will change to blue 1
line 5 (ad) will change to red cell with number 4 in it
line 5 (ac) will change to a blue cell with number 1 in it
line 6 (ac) will change to blue 4
line 6 (ad) will change to green 2
line 6 (ae) will change to red 1

if no matches..leave alone

I hope this is clear...and thxs

mike
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi Mike,

You dont need a macro. Try this:

Select AC4:AF6 (and keep selected)

Conditional Formatting > New Rule > Use a formula to determine...
Insert this formula
=AC4=$BW4
Format button
Fill ---> Red
ok, ok

Conditional Formatting > New Rule > Use a formula to determine...
Insert this formula
=AC4=$BX4
Format button
Fill ---> Green
ok, ok

Conditional Formatting > New Rule > Use a formula to determine...
Insert this formula
=AC4=$BY4
Format button
Fill ---> Blue
ok, ok

Done!

HTH

M.
 
Upvote 0
MB....

Is there a way once I have the colors in my group , then change another group to reflect same colors? I need the next group here to have same colors.

thxs
mike


<table border="0" cellpadding="0" cellspacing="0" width="583"><col style="mso-width-source:userset;mso-width-alt:1865;width:38pt" width="51"> <col style="mso-width-source:userset;mso-width-alt:1499;width:31pt" width="41"> <col style="mso-width-source:userset;mso-width-alt:1572;width:32pt" width="43"> <col style="mso-width-source:userset;mso-width-alt:1536;width:32pt" width="42"> <col style="mso-width-source:userset;mso-width-alt:1828;width:38pt" width="50"> <col style="mso-width-source:userset;mso-width-alt:1865;width:38pt" width="51"> <col style="mso-width-source:userset;mso-width-alt:1792;width:37pt" width="49"> <col style="mso-width-source:userset;mso-width-alt:1938;width:40pt" width="53"> <col style="mso-width-source:userset;mso-width-alt:1718;width:35pt" width="47"> <col style="mso-width-source:userset;mso-width-alt:1938;width:40pt" width="53"> <col style="mso-width-source:userset;mso-width-alt:1901;width:39pt" width="52"> <col style="mso-width-source:userset;mso-width-alt:1865;width:38pt" width="51"> <tbody><tr style="height:12.75pt" height="17"> <td class="xl65" style="height:12.75pt;width:38pt" height="17" width="51">4</td> <td class="xl65" style="width:31pt" width="41">3</td> <td class="xl65" style="width:32pt;background:#00B050;mso-pattern: black none" width="43">2</td> <td class="xl65" style="width:32pt;background:#00B0F0;mso-pattern: black none" width="42">1</td> <td class="xl78" style="width:38pt" width="50">3.70</td> <td class="xl78" style="width:38pt" width="51">8.50</td> <td class="xl78" style="width:37pt" width="49">2.10</td> <td class="xl78" style="width:40pt" width="53">5.90</td> <td class="xl65" style="width:35pt" width="47">
</td> <td class="xl79" style="width:40pt" width="53">6</td> <td class="xl80" style="width:39pt" width="52">2</td> <td class="xl81" style="width:38pt" width="51">1</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl65" style="height:12.75pt;background:#00B0F0;mso-pattern: black none" height="17">1</td> <td class="xl65" style="background:red;mso-pattern:black none">4</td> <td class="xl65">3</td> <td class="xl65" style="background:#00B050;mso-pattern:black none">5</td> <td class="xl78">3.95</td> <td class="xl78">5.00</td> <td class="xl78">2.20</td> <td class="xl78">5.25</td> <td class="xl65">
</td> <td class="xl79">4</td> <td class="xl80">5</td> <td class="xl81">1</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl65" style="height:12.75pt" height="17">4</td> <td class="xl65">1</td> <td class="xl65" style="background:#00B050;mso-pattern:black none">6</td> <td class="xl65">2</td> <td class="xl78">1.10</td> <td class="xl78">6.05</td> <td class="xl78">6.15</td> <td class="xl78">44.25</td> <td class="xl65">
</td> <td class="xl79">3</td> <td class="xl80">6</td> <td class="xl81">5</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl65" style="height:12.75pt;background:#00B050;mso-pattern: black none" height="17">6</td> <td class="xl65" style="background:#00B0F0;mso-pattern:black none">1</td> <td class="xl65">9</td> <td class="xl65">5</td> <td class="xl78">2.90</td> <td class="xl78">3.35</td> <td class="xl78">2.70</td> <td class="xl78">7.75</td> <td class="xl65">
</td> <td class="xl79">3</td> <td class="xl80">6</td> <td class="xl81">1</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl65" style="height:12.75pt;background:#00B050;mso-pattern: black none" height="17">5</td> <td class="xl65">7</td> <td class="xl65">3</td> <td class="xl65">2</td> <td class="xl78">3.75</td> <td class="xl78">0.85</td> <td class="xl78">8.75</td> <td class="xl78">13.60</td> <td class="xl65">
</td> <td class="xl79">4</td> <td class="xl80">5</td> <td class="xl81">1</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl65" style="height:12.75pt;background:#00B0F0;mso-pattern: black none" height="17">4</td> <td class="xl65" style="background:#00B050;mso-pattern:black none">2</td> <td class="xl65" style="background:red;mso-pattern:black none">1</td> <td class="xl65">6</td> <td class="xl78">4.15</td> <td class="xl78">12.30</td> <td class="xl78">1.85</td> <td class="xl78">3.05</td> <td class="xl65">
</td> <td class="xl79">1</td> <td class="xl80">2</td> <td class="xl81">4</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl65" style="height:12.75pt" height="17">8</td> <td class="xl65" style="background:red;mso-pattern:black none">7</td> <td class="xl65">6</td> <td class="xl65">5</td> <td class="xl78">2.90</td> <td class="xl78">2.60</td> <td class="xl78">3.65</td> <td class="xl78">6.85</td> <td class="xl65">
</td> <td class="xl79">7</td> <td class="xl80">3</td> <td class="xl81">4</td> </tr> </tbody></table>
 
Upvote 0
Mike,

Select the new range (AG4:AJ10 i suppose) and do exactly the same, ie,
apply the same formulas and formats, for example

=AC4=$BW4
Format button
Fill ---> Red
ok, ok



M
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top