close

Can anybody please tell me how you add a pivot table to an existing
sheet using VBA. I currently have the code:

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, _
SourceData:=quot;=Dataquot;).CreatePivotTable TableDestination:=quot;quot;, _
TableName:=quot;Part2quot;

PLEASE PLEASE HELP--
moglione1
------------------------------------------------------------------------
moglione1's Profile: www.excelforum.com/member.php...oamp;userid=26414
View this thread: www.excelforum.com/showthread...hreadid=508433You can specify the sheet and range in the TableDestination argument:

TableDestination:=Sheets(quot;Pivotquot;).Cells(3, 1)

moglione1 wrote:
gt; Can anybody please tell me how you add a pivot table to an existing
gt; sheet using VBA. I currently have the code:
gt;
gt; ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, _
gt; SourceData:=quot;=Dataquot;).CreatePivotTable TableDestination:=quot;quot;, _
gt; TableName:=quot;Part2quot;
gt;
gt; PLEASE PLEASE HELP
gt;
gt;--
Debra Dalgleish
Excel FAQ, Tips amp; Book List
www.contextures.com/tiptech.html

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()