Excel VBA - Color Code Column cells based on values
Closed
jdmurphy
Posts
1
Registration date
Monday 22 December 2014
Status
Member
Last seen
22 December 2014
-
22 Dec 2014 à 10:20
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 23 Dec 2014 à 11:25
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 23 Dec 2014 à 11:25
Related:
- Excel vba color code
- Sound card color code - Guide
- Vba color index - Guide
- Rj45 color code - Guide
- Excel vba find - Guide
- Vba excel mac - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
23 Dec 2014 à 11:25
23 Dec 2014 à 11:25
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