Nanogirl21
Active Member
- Joined
- Nov 19, 2013
- Messages
- 331
- Office Version
- 365
- Platform
- Windows
Can someone please help with a VBA to do the following
(1) Clear conditional formatting from worksheet titled Tracking
(2) Apply conditional formatting for all rows in column O with the below rules
a. change cell background to LIGHT GREEN if formula is true
b. change cell background to ORANGE if formula is true
c. change cell background to RED if formula is true
Notes
-I’d like to use conditional formatting because I need the cell colors to change when making updates throughout the day.
-I don’t want to apply the rules manually because there are a lot and they would need to be changed often. It’s easier to create a VBA code for each set of rules I’d like to apply.
-If there is any way to make the formulas I used simpler I am all for it!
-T1 and L1 would change to T2, T3, T4, T5 and L2, L3, L4, L5 ect since the rules will be applied to the entire column. I don’t have an exact amount of rows because the data is constantly growing.
- It would be great if I could add a HEX code or RGB for the color i'd like the cell background to.
Thank you.
(1) Clear conditional formatting from worksheet titled Tracking
(2) Apply conditional formatting for all rows in column O with the below rules
a. change cell background to LIGHT GREEN if formula is true
Code:
=OR(T1="APPLE", T1="BANANA", T1="APPLE / HOLD", T1="BANANA / HOLD")
b. change cell background to ORANGE if formula is true
Code:
=SEARCH("HOLD",T1)
Code:
=AND(OR($L1="GRAPES",$L1="CUCUMBER",$L1="TOMATO"),$O1<10)
Notes
-I’d like to use conditional formatting because I need the cell colors to change when making updates throughout the day.
-I don’t want to apply the rules manually because there are a lot and they would need to be changed often. It’s easier to create a VBA code for each set of rules I’d like to apply.
-If there is any way to make the formulas I used simpler I am all for it!
-T1 and L1 would change to T2, T3, T4, T5 and L2, L3, L4, L5 ect since the rules will be applied to the entire column. I don’t have an exact amount of rows because the data is constantly growing.
- It would be great if I could add a HEX code or RGB for the color i'd like the cell background to.
Thank you.