change color of each row in data range based on the number in respective cell of a column

awagdarikar

Board Regular
Joined
Jun 20, 2008
Messages
115
Dear Excel / VB Experts,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p> </o:p>
I want to change color of each row in data range A1:AF500 based on the number in respective row in the AG Column. For example, the color of row A1:AF1 should change with the number entry in cell AG1 and so on for all the rows till row 500. I know this can be easily achieved with Conditional Formatting but the hitch is my conditions are more than 3. The conditions are as follows,<o:p></o:p>
<o:p> </o:p>
  • If Cell Value is 5 then the respective row color has to be changed to Turquoise (Color Index 8) <o:p></o:p>
  • If Cell Value is 6 or 7 or 8, then the respective row color has to be changed to Lavender (Color Index 39) <o:p></o:p>
  • If Cell Value is 9 then the respective row color has to be changed to Yellow (Color Index 6)<o:p></o:p>
  • If Cell Value is 10 then the respective row color has to be changed to Green (Color Index 4)<o:p></o:p>
  • No action to be taken if the cell contains any other value than the conditions listed above<o:p></o:p>
I do not know VB much so I searched through the Mrexcel Archives and Google but could not get one code which could satisfy my needs.

:oops:

Can somebody suggest me a simple VB program which I can use to achieve this?<o:p></o:p>
<o:p> </o:p>
Thanks a ton in advance,<o:p></o:p>
<o:p> </o:p>
awagdarikar<o:p></o:p>
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I am sorry but i have already stated my problem that I do not know much of VB. I had already seen this particular webpage but do not know how to tweak the code to adopt to solve my problem.
Please suggest,

awagdarikar
:confused:
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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