Help required with setting up a pivot table with the source on sheet1 to have the pivot table create

D

Diana

Try using the actual location:
TableDestination:="[YourWorkbookName]Report!R3C1"

As opposed to:
TableDestination:=""

I hope this helps.

-----Original Message-----
How would I have to change this code so that the pivot
table is created on the sheet named "Report" within the
active workbook?
ActiveWorkbook.PivotCaches.Add
(SourceType:=xlDatabase, SourceData:="data"). _
CreatePivotTable TableDestination:="", TableName:="PivotTable1"
ActiveSheet.PivotTableWizard
TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").SmallGrid = False
ActiveSheet.PivotTables("PivotTable1").AddFields
RowFields:=Array("PDWK", "WK - HM Store", _
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top