Automated row coloring macro (based on value of a particular cell)

medwardnfriends

New Member
Joined
Jun 20, 2011
Messages
22
I need rows to automatically fill with a particular color based on the value of the cell in column V of that row. So if cell V10 says for example: "John", the entire row 10 will become blue. If it says "Mike", row 10 will become green, etc. There are four possible names and corresponding colors, which are listed in cells A121 to A124. Is there a macro or other function that will allow me to do this? Thank you in advance.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

You need 4 rules one for each name ~
Select row 10 then conditional format, new rule, use a formula...
Rule 1 =$V$10="John" Format Blue. then select new rules and do the same for the other names and click apply.
 
Upvote 0
Thank you that works. However, i have 120 rows of data, do I need to repeat this process of making 4 rules for every row? or can i highlight all the rows and change the formula slightly to make this work?
 
Upvote 0
Highlight all the rows, then enter the CF formulas referring to the top row in your selection. Excel will adjust the formulas for the lower rows automatically.

N.B the formula would need to be like this

Rule 1 =$V10="John"

(No $ before the 10)
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

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