Conditional formating Pivot table row if subtal > x

netuser

Active Member
Joined
Jun 19, 2015
Messages
420
Hi,

I need to know how can i conditionnal format a whole row based on value in subtotal of that row in a Pivot table.

I tried normal Conditional formating that work great but whenever the pivot table is refreshed which add/remove columns it no more work as Subtotal Column changes

Here is my Normal code but I need somthing Dynamic so if Subtotal column (AA) change it apply it again.


Code:
Lastrow = Range("C" & Rows.Count).End(xlUp).Row

Cells.FormatConditions.Delete 

    With Range("D6:AA" & Lastrow)
    .FormatConditions.Add Type:=xlExpression, Formula1:="=$AA6>299999"
    .FormatConditions(.FormatConditions.Count).SetFirstPriority
    .FormatConditions(1).Interior.PatternColorIndex = xlAutomatic
    .FormatConditions(1).Interior.Color = 15849925
    .FormatConditions(1).Interior.TintAndShade = 0
    .FormatConditions(1).Font.Bold = True
    .FormatConditions(1).Font.Color = -16776961
    .FormatConditions(1).StopIfTrue = False
    End With

I have 2 data Fields "Nb_Data" and "Amt_Data" Condition should be on Subtotal of Amt_Data but should highlight whole row with both Fields


Thanks for your help
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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