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 do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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