With ActiveSheet.PivotTables(“SalesPivotTable”).PivotFields(“Local Legal Entity Code”) MissingItemsLimit = xlMissingItemsDefaultĪctiveSheet.PivotTables(“SalesPivotTable”).RepeatAllLabels xlRepeatLabels With ActiveSheet.PivotTables(“SalesPivotTable”).PivotCache With ActiveSheet.PivotTables(“SalesPivotTable”) “PivotTable!R1C1″, TableName:=”SalesPivotTable”, DefaultVersion:=6 PRange, Version:=6).CreatePivotTable TableDestination:= _ Set PRange = DSheet.Cells(1, 1).Resize(LastRow1, LastCol)Ī(SourceType:=xlDatabase, SourceData:= _
#Enable vba in excel 2016 code#
I have delete that part of the code and add it like this and it is working for me: With ActiveSheet.PivotTables("SalesPivotTable").PivotFields ("Amount")ĪctiveSheet.PivotTables("SalesPivotTable").ShowTableStyleRowStripes = TrueĪctiveSheet.PivotTables("SalesPivotTable").TableStyle2 = "PivotStyleMedium9" With ActiveSheet.PivotTables("SalesPivotTable").PivotFields("Zone")
![enable vba in excel 2016 enable vba in excel 2016](https://www.addintools.com/documents/excel/images/excel-visual-basic-editor-menus-597-538.png)
![enable vba in excel 2016 enable vba in excel 2016](https://www.rondebruin.nl/win/images/cellmenu1.png)
With ActiveSheet.PivotTables("SalesPivotTable").PivotFields("Month") With ActiveSheet.PivotTables("SalesPivotTable").PivotFields("Year") (TableDestination:=PSheet.Cells(1, 1), TableName:="SalesPivotTable") _ĬreatePivotTable(TableDestination:=PSheet.Cells(2, 2), _ (SourceType:=xlDatabase, SourceData:=PRange). Set PRange = DSheet.Cells(1, 1).Resize(LastRow, LastCol) LastCol = DSheet.Cells(1, Columns.Count).End(xlToLeft).Column LastRow = DSheet.Cells(Rows.Count, 1).End(xlUp).Row