ianb
Member
Hi All,
conditional formatting does not work around a pivot table if asking for all grey after the pivot tabel has more then less columns except for the left column under the pivot table when changed using ="" and the colur grey.
I was attempting to write a VBA program for everytime a pivottable is changed.
I need to have this so the front part of the spreadsheet does not move from the position of the change or the button click.
Can any one advise on the changes to this program. I will be using a spinner button or the pivot table button to change the pivot tables. I would like to keep the grey colour at the background (in all cells) and the pivot table remains white.
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
'Sub CondFormat_Indiv()
Dim PrevCell As Range
Set PrevCell = ActiveCell
Range("A83:ac159").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="="""""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249946592608417
End With
PrevCell.Select
'Range("e79").Select
End Sub
conditional formatting does not work around a pivot table if asking for all grey after the pivot tabel has more then less columns except for the left column under the pivot table when changed using ="" and the colur grey.
I was attempting to write a VBA program for everytime a pivottable is changed.
I need to have this so the front part of the spreadsheet does not move from the position of the change or the button click.
Can any one advise on the changes to this program. I will be using a spinner button or the pivot table button to change the pivot tables. I would like to keep the grey colour at the background (in all cells) and the pivot table remains white.
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
'Sub CondFormat_Indiv()
Dim PrevCell As Range
Set PrevCell = ActiveCell
Range("A83:ac159").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="="""""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249946592608417
End With
PrevCell.Select
'Range("e79").Select
End Sub