New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Need your help

Macros, VBA, Excel Automation, etc.

Need your help

Postby ashokbioinfo » Wed Jan 04, 2012 3:54 am

I have created pivot table using macro recording as I don't know much more about programming. I want to copy the whole pivot into a new sheet. and delete the old sheet. what is the macro I need to add.
I am getting error while shifting pivot to other sheet


ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Data!R1C1:R65536C3", Version:=xlPivotTableVersion10).CreatePivotTable _
TableDestination:="Sheet5!R3C1", TableName:="PivotTable3", DefaultVersion _
:=xlPivotTableVersion10

Advance thanks for your help.
  • 0

ashokbioinfo
Rookie
 
Posts: 1
Joined: Jan 4, 2012
Reputation: 0

Re: Need your help

Postby Sisyphus » Thu Jan 05, 2012 3:30 am

Hi,
I've been waiting for Don to find your question because he knows about pivot tables as well as more recent versions of Excel. You are using Excel 2010, right?
I'm struck by the R1C1 references in the formula you published. Have you tried to replace them with A1 type references reflecting your actual needs? Can you upload a sample workbook? I can't quite imagine a circumstance where this removal of a pivot table from an existing to a new sheet would be repetitive. Can you explain the purpose? It might help finding the best solution.
Have a great day! :D
  • 0

Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: Google Adsense [Bot] and 247 guests