title: Choose positions in the pivot table
body: <p>I have a macro that creates a PivotTable for me with the fields I want. However, I would like them to choose the indicated values.This is what the table looks like at the start
  <a href="https://i.stack.imgur.com/tpypE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tpypE.png" alt="enter image description here" /></a></p>
  <p>here is what I would like e.g.
  <a href="https://i.stack.imgur.com/gNfh4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gNfh4.png" alt="enter image description here" /></a></p>
  <p>this is my code:</p>
  <pre><code>Set sh_s = wbMe.Sheets(&quot;kredyty&quot;)
   lr1 = sh_s.Range(&quot;A&quot; &amp; Rows.Count).End(xlUp).Row
   ptver1 = 6
   tbName1 = &quot;Tabela przestawna&quot;
   Sheets.Add after:=Sheets(Sheets.Count)
   Set sh_d = ActiveSheet
   ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, _
     SourceData:=sh_s.Name &amp; &quot;!R1C1:R&quot; &amp; lr1 &amp; &quot;C58&quot;, Version:=ptver).CreatePivotTable _
     TableDestination:=sh_d.Name &amp; &quot;!R3C1&quot;, TableName:=tbName1, _
     DefaultVersion:=ptver1
   With sh_d.PivotTables(tbName1)
    With .PivotFields(&quot;CRD_RWG&quot;)
     .Orientation = xlPageField
       .Position = 1
     With sh_d.PivotTables(tbName1)
    With .PivotFields(&quot;NEW_DEFAULT&quot;)
       .Orientation = xlPageField
       .Position = 1
     End With
     .AddDataField .PivotFields(&quot;CRD_EKSP_PIER_DC_FIN&quot;), &quot;Suma z Ekspozycji&quot;, xlSum
     .AddDataField .PivotFields(&quot;CRD_KOR_DC_FIN&quot;), &quot;Suma z Korekty&quot;, xlSum
         End With
  </code></pre>