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 last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

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