Pivot Table Macro issue

natetc

Board Regular
Joined
Oct 2, 2008
Messages
127
This is the error that comes up when I try to run my macro:

Run-time error '5'
Invalid procedure call or argument
____

Here is my code that needs to be debugged:

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"3!R1C1:R65536C12", Version:=xlPivotTableVersion10).CreatePivotTable _
TableDestination:="Sheet4!R3C1", TableName:="PivotTable14", DefaultVersion _
:=xlPivotTableVersion10

____

What I'm trying to achieve:

3 sheets with data, and for each sheet I want to create a pivot table on 3 new sheets. The result will be a total of 6 sheets (3 data/ 3 pivot tables).

Thanks in advance!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
It works fine for me, having some normal data in sheet 3, columns A to L with headings, and an empty sheet4.
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top