VBA - Error in code - Pivot Cache

candacem

New Member
Joined
Sep 8, 2017
Messages
18
This is my pivot cache but I keep getting an error message :( My google cave isn't helping so hoping one of you genius' are able to help.

Thanks in advance!

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sum_Data!R1C1:R5000C19", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="", TableName:="Pivot!R1C1", DefaultVersion:=xlPivotTableVersion14
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
My guess is that error is in:
Code:
With myPivotTable
	With .PivotFields("Class").Orientation = xlRowField
		With .PivotFields("Jan-18")
			.Orientation = xlDataField
			.Position = 1
			.Functiom = xlSum
			.NumberFormat = "#,##0.00"
		End With
	End With


	With Application
		.ScreenUpdating = True
		.EnableEvents = True
	End With
End With



Change it to (first make a copy of your subroutine for backup):
Code:
With myPivotTable
	.PivotFields("Class").Orientation = xlRowField
	With .PivotFields("Jan-18")
		.Orientation = xlDataField
		.Position = 1
		.Functiom = xlSum
		.NumberFormat = "#,##0.00"
	End With
End With
	
With Application
	.ScreenUpdating = True
	.EnableEvents = True
End With
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,229
Members
453,026
Latest member
cknader

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