Pindub_Amateur
Pindub_Amateur

Reputation: 328

How do i place my pivot table at a specific location?

The below code creates the pivot table for me. But i don't know to change the location of the destination where the pivot table is created. It always creates a new sheet for the pivot table. I want to be able to create multiple pivot tables in a single sheet.

Sub makeHyperIncPivots()
   ActiveWorkbook.Sheets("Hypercare INC").Select
   Range("A1").Select
   Set objtable = Sheets("Hypercare INC").PivotTableWizard

   Set objfield = objtable.PivotFields("Status Title")
   objfield.Orientation = xlRowField

   Set objfield = objtable.PivotFields("Create Week")
   objfield.Orientation = xlColumnField

   Set objfield = objtable.PivotFields("Process Ref")
   objfield.Orientation = xlDataField
   objfield.Function = xlCount

   Sheets("HcINCPivot").PrintPreview



End Sub

Upvotes: 0

Views: 497

Answers (1)

Pindub_Amateur
Pindub_Amateur

Reputation: 328

It was so simple.

 Set objtable = Sheets("Hypercare INC").PivotTableWizard(TableDestination:="'Hypercare INC Pivot'!R3C1")

Upvotes: 1

Related Questions