How to condition format Datafields in Pivot with VBA?

ongharry1014

New Member
Joined
May 11, 2013
Messages
13
I have a Pivot table that looks like below. I need to conditional format just the WOS row to highlight cells that are less than 0 in red, 0.1 to 1.5 in yellow and anything above 1.5 in green. The pivot must keep the formatting when I move the pivot fields around. I have made various attempts on building a code but none of them works.

I wonder if anyone here could help me out with this. Thank you so much!


Site CodeValues10/16/201710/23/201710/30/201711/6/201711/13/201711/20/201711/27/201712/4/201712/11/201712/18/201712/25/20171/1/20181/8/2018
0875Forecast 2049615406397395415441420427424388369375
Supply 2525128006400640320320640320320320640
Cumulative Delta 4761141735978583808687587800696628579844
WOS 1.082.751.782.391.432.011.721.451.971.701.561.502.29
0874Forecast 772418418418418446555554555555275274275
Supply 20832560512512256512512512512256256256
Cumulative Delta 13111149731825919729686644601558539521502
WOS 2.772.351.551.822.111.761.791.811.831.861.761.681.60
32F2Forecast 2026469256250253247235223229226242230237
Supply 185500128006403203203200320320320
Cumulative Delta -171-640-896134-119274359456547321399489572
WOS -0.63-2.67-3.760.57-0.511.181.541.912.251.301.521.711.85
33SCForecast 188394241394041323131322926
Supply 210001600016000016000
Cumulative Delta 22-17-596021-191006837613410579
WOS 0.58-0.46-1.641.750.64-0.613.462.501.460.256.205.284.55
Z201Forecast 1000224110140110139181180181181454545
Supply 11043200320032003200320000
Cumulative Delta 10420090270160341160300119258213168123
WOS 0.661.310.622.031.283.021.663.741.875.454.473.532.58

<colgroup><col><col><col span="3"><col><col span="3"><col><col span="3"><col span="2"></colgroup><tbody>
</tbody>

<colgroup><col><col span="3"><col><col span="3"><col><col span="3"><col span="2"></colgroup><tbody>
</tbody>
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,215,063
Messages
6,122,934
Members
449,094
Latest member
teemeren

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