Macro errors

Mikeykt

New Member
Joined
Feb 10, 2011
Messages
47
Hi,

I'm creating the Macro for a pivot table.

There are a couple of errors that tstop it running, I've checked it and can't see why it is, can anyone shed some light on what needs changing the macro is:

GiftPivot Macro
'
'
Columns("A:A").Select
Selection.NumberFormat = "0"
Columns("A:Q").Select
Sheets.Add
ActiveWorkbook.Worksheets("Sheet1").PivotTables("PivotTable6").PivotCache. _
CreatePivotTable TableDestination:="Sheet3!R3C1", TableName:="PivotTable7" _
, DefaultVersion:=xlPivotTableVersion12
Sheets("Sheet3").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable7").PivotFields( _
"CAMPAIGN_RESPONDED_TO " _
)
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable7").PivotFields( _
"CAMPAIGN_NUMBER_RESPONDED_TO " _
)
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable7").PivotFields( _
"CAMPAIGN_YEAR_OF_JOINING " _
)
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable7").PivotFields( _
"CAN_MAIL " _
)
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable7").PivotFields( _
"CAN_PHONE " _
)
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable7").PivotFields("PAYMENT RANKING")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable7").PivotFields( _
"NUMBER OF MONTHS SINCE PAYMENT")
.Orientation = xlColumnField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields( _
"NAME_KEY " _
), _
"Count of NAME_KEY " _
, xlCount
End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,224,521
Messages
6,179,290
Members
452,902
Latest member
Knuddeluff

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