Hey JP,
One thing I need to alter for this line of code. The reason I needed to select the sum of values in the pivot table is to apply conditional formatting. The code I have to do this is as follows:
Sub ConditionalFormatPT2()
ActiveSheet.PivotTables("ItemList").DataBodyRange.Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(C10))=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.499984740745262
End With
One thing that I need to change, is this is selecting my "Grand Total" at the bottom of the pivot table. However, I do not want to Conditional Format this line. How can I Offset this? I tried changing the DataBodyRange select statement to:
ActiveSheet.PivotTables("ItemList").DataBodyRange.Offset(-1,0).Select
This did work to not select the "Grand Total" row, but it just shifted the selected range up 1 which included the pivot table headers. I'd like to select the databody range minus the grand total row. Any advice?
Bookmarks