Excel VBA - Color Code Column cells based on values
Closed
jdmurphy
Posts
1
Registration date
Monday December 22, 2014
Status
Member
Last seen
December 22, 2014
-
Dec 22, 2014 at 10:20 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Dec 23, 2014 at 11:25 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Dec 23, 2014 at 11:25 AM
Related:
- Excel vba color code
- Battery reset code - Guide
- Samsung volume increase code - Guide
- Number to words in excel formula without vba - Guide
- Sound card color code - Guide
- Cat5e color code - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Dec 23, 2014 at 11:25 AM
Dec 23, 2014 at 11:25 AM
Hi Jdmurphy,
No need for VBA here.
Select cell I3, go to start ribbon > conditional format > manage rules > new rule.
1) =I3<1.5 --> format Green
2) =AND(I3>=1.5,I3<=2.989) --> format Yellow
3) =I3>2.989 --> format Red
Don't forget to apply the format.
Now drag cell I3 down as far as needed applying format only.
When you don't want empty cells to be green then change the first rule into:
=AND(I3>0,I3<1.5) --> format Green
I took the liberty to alter the numbers and symbols a bit to prevent gabs in the format.
Best regards,
Trowa
No need for VBA here.
Select cell I3, go to start ribbon > conditional format > manage rules > new rule.
1) =I3<1.5 --> format Green
2) =AND(I3>=1.5,I3<=2.989) --> format Yellow
3) =I3>2.989 --> format Red
Don't forget to apply the format.
Now drag cell I3 down as far as needed applying format only.
When you don't want empty cells to be green then change the first rule into:
=AND(I3>0,I3<1.5) --> format Green
I took the liberty to alter the numbers and symbols a bit to prevent gabs in the format.
Best regards,
Trowa