![[wavey] [wavey] [wavey]](/data/assets/smilies/wavey.gif)
I have been coding an automated system of creating Pivot tables and colouring certain lines on the report in VBA.
I have managed to Create a document with accurate pivot tables and coloured the required lines. The problem i am getting is that when the data is refreshed on the pivot table the colourings that my code put in dissapear. I have tried setting up my code to create pivot tables which "Preserve Formatting" but still any 'coded' colours are lost on refresh. if i manually add colours to the pivot they stay there even when the data has been refreshed.
![[wiggle] [wiggle] [wiggle]](/data/assets/smilies/wiggle.gif)
Can Visual Basic on do 'Cosmetic' Changes to the pivot tables or am i missing something in the code below. The code below is just the pivot creation section. I add the colours later on in my prog.
I would greatly appreciate any help with this, as its starting to do my head in. Good ole Microsoft!
![[rofl] [rofl] [rofl]](/data/assets/smilies/rofl.gif)
Thanks In advance!
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
Sorry ive tried to tidy it up a bit
Code Extract:
ActiveSheet.PivotTableWizard SourceType:=xlPivotTable, SourceData:= _
"[" & Retailer & " " & Category & " DATA.XLS]£,U,D by Month!PivotTable1", TableDestination:="", _
TableName:="PivotTable2"
ActiveSheet.PivotTables("PivotTable2"
False, False, False, False, False, False, False, False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable2"
False, False, False, False, False, False, False, False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable2"
False, False, False, False, False, False, False, False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable2"
False, False, False, False, False, False, False, False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable2"
False, False, False, False, False, False, False, False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable2"
"Description", "Type", "Flavour", "Size"
With ActiveSheet.PivotTables("PivotTable2"
.ColumnGrand = False
.RowGrand = False
.HasAutoFormat = False
.PreserveFormatting = True
End With
With ActiveSheet.PivotTables("PivotTable2"
.Orientation = xlDataField
.Name = "Value "
.NumberFormat = "£#,##0.00"
End With
![[pc3] [pc3] [pc3]](/data/assets/smilies/pc3.gif)
Adam
![[glasses] [glasses] [glasses]](/data/assets/smilies/glasses.gif)