perhaps name the green area around the pivot table (including the pivot table itself) "pivotBorder" then add this code to the sheet
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Const csRANGENAME As String = "pivotBorder"
On Error Resume Next
Me.Range(csRANGENAME).Interior.ColorIndex = xlColorIndexAutomatic
On Error GoTo 0
With Target.TableRange1
With .Offset(-2, -1).Resize(.Rows.Count + 8, .Columns.Count + 2)
.Name = csRANGENAME
.Interior.Color = 1242669
End With
.Interior.ColorIndex = xlColorIndexAutomatic
End With
End Sub
Bookmarks