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.
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
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