title: Macro code to create mutile pivot in same sheet
body: <p>I have created a macro code where in only one pivot table gets created, can some one help me in creating mutilple pivot table in single sheet.</p>
  
  <p>The below code i am using, here the filter selects only for india, in next H column i want the same pivot table where in it selects EMEA</p>
  
  <p>and in next Q column the filter selects others</p>
  
  <p>code:</p>
  
  <pre><code>Sub pivottable()
  Dim PSheet As Worksheet
  Dim DSheet As Worksheet
  Dim PCache1 As PivotCache
  Dim PTable As pivottable
  Dim PRange As Range
  Dim LastRow As Long
  Dim LastCol As Long
  On Error Resume Next
  Application.DisplayAlerts = False
  Worksheets("PivotTable").Delete
  Sheets.Add Before:=ActiveSheet
  ActiveSheet.Name = "PivotTable"
  Application.DisplayAlerts = True
  Set PSheet = Worksheets("PivotTable")
  Set PSheet = Worksheets("PivotTable2")
  Set DSheet = Worksheets("Raw Data")
  
  LastRow = DSheet.Cells(Rows.Count, 1).End(xlUp).Row
  LastCol = DSheet.Cells(1, Columns.Count).End(xlToLeft).Column
  Set PRange = DSheet.Cells(1, 1).Resize(LastRow, LastCol)
  
  Set PCache = ActiveWorkbook.PivotCaches.Create _
  (SourceType:=xlDatabase, SourceData:=PRange). _
  CreatePivotTable(TableDestination:=PSheet.Cells(2, 2), _
  TableName:="PivotTable")
  
  Set PTable = PCache.CreatePivotTable _
  (TableDestination:=PSheet.Cells(1, 1), TableName:="PivotTable")
  
  Sheets("PivotTable").Select
  
  With ActiveSheet.PivotTables("PivotTable").PivotFields("Region")
          .Orientation = xlPageField
          .Position = 1
      End With
  ActiveSheet.PivotTables("PivotTable").PivotFields("Region").CurrentPage = _
          "INDIA"
  
  
  With ActiveSheet.PivotTables("PivotTable").PivotFields("Assignment Group")
   .Orientation = xlRowField
   .Position = 1
  
  
   End With
  
  
  
   With ActiveSheet.PivotTables("PivotTable").PivotFields("Aging")
   .Orientation = xlColumnField
    .Position = 1
    End With
  
    ActiveSheet.PivotTables("PivotTable").AddDataField ActiveSheet.PivotTables( _
    "PivotTable").PivotFields("Number"), "Count of Number", xlCount
    ActiveSheet.PivotTables("PivotTable").PivotFields("Assignment group"). _
          AutoSort xlDescending, "Count of Number"
  
  
  
  
  End Sub
  </code></pre>