既存のシートにピボット テーブルを作成し、データを新しいスプレッド シートにコピーするプロジェクトを 1 つ実行しました。それがあなたの質問である場合..以下のコードを参照してください
Dim objtable as pivottable, objfield as pivotfield
set objtable = sheet1.pivotwizard
ptname = activesheet.pivottables(1).name 'this code is to give pivot table name which will help in creating new pivot tables
set objfield.objtable.pivotfields("Month") 'this code will select month in page field
objfield.orientation = xlpagefield
set objfield = objtable.pivotfields ("Dept & Mgr") 'this code will select dept & mgr in page field
objfield.orientation = xlpagefield
set objfield = objtable.pivotfields("Legal Entity") 'this code will select legal entity in row field
objfield.orientation = xlrowfield
set objfield = objtable.pivotfields("Cost Code") 'this code will select cost code in row field
objfield.orientation = xlrowfield
set objfield = objtable.pivotfields("CC Description") 'this code will select CC Description in row field
objfield.orientation = xlrowfield
set objfield = objtable.pivotfields("User") 'this code will select Usr in row field
objfield.orientation = xlrowfield
set objfield = objtable.pivotfields("Carrier") 'this code will select carrier in row field
objfield.orientation = xlrowfield
set objfield = objtable.pivotfields("Description") 'this code will select Description in row field
objfield.orientation = xlrowfield
set objfield = objtable.pivotfields("Amount Incl Tax") 'this code will amount incl tax in Datafield
objfield.orientation = xlDatafield
activesheet.pivottables(ptname).format xlreport6 '