Unable to run macros after recording macros

063azi

New Member
Joined
Jun 17, 2020
Messages
13
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Sub Macro7()
'
' Macro7 Macro
'
ActiveCell.Offset(-2, -6).Range("A1").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"PAF Folder!R1C1:R1048576C10", Version:=6).CreatePivotTable TableDestination _
:="City-Wise Payout!R3C1", TableName:="PivotTable11", DefaultVersion:=6
Sheets("City-Wise Payout").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable11")
.ColumnGrand = True
.HasAutoFormat = True
.DisplayErrorString = False
.DisplayNullString = True
.EnableDrilldown = True
.ErrorString = ""
.MergeLabels = False
.NullString = ""
.PageFieldOrder = 2
.PageFieldWrapCount = 0
.PreserveFormatting = True
.RowGrand = True
.SaveData = True
.PrintTitles = False
.RepeatItemsOnEachPrintedPage = True
.TotalsAnnotation = False
.CompactRowIndent = 1
.InGridDropZones = False
.DisplayFieldCaptions = True
.DisplayMemberPropertyTooltips = False
.DisplayContextTooltips = True
.ShowDrillIndicators = True
.PrintDrillIndicators = False
.AllowMultipleFilters = False
.SortUsingCustomLists = True
.FieldListSortAscending = False
.ShowValuesRow = False
.CalculatedMembersInFilters = False
.RowAxisLayout xlCompactRow
End With
With ActiveSheet.PivotTables("PivotTable11").PivotCache
.RefreshOnFileOpen = False
.MissingItemsLimit = xlMissingItemsDefault
End With
ActiveSheet.PivotTables("PivotTable11").RepeatAllLabels xlRepeatLabels
With ActiveSheet.PivotTables("PivotTable11").PivotFields("City")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable11").AddDataField ActiveSheet.PivotTables( _
"PivotTable11").PivotFields("Amount"), "Sum of Amount", xlSum
With ActiveSheet.PivotTables("PivotTable11").PivotFields("Payment Status")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable11").PivotFields("City")
.PivotItems("(blank)").Visible = False
End With
ActiveSheet.PivotTables("PivotTable11").PivotFields("Payment Status"). _
CurrentPage = "(All)"
With ActiveSheet.PivotTables("PivotTable11").PivotFields("Payment Status")
.PivotItems("Failed").Visible = False
.PivotItems("(blank)").Visible = False
End With
ActiveSheet.PivotTables("PivotTable11").PivotFields("Payment Status"). _
EnableMultiplePageItems = True
With ActiveSheet.PivotTables("PivotTable11").PivotFields( _
"Paid via Careem account")
.Orientation = xlColumnField
.Position = 1
End With
End Sub

can any body help me I'm unable to run macros after recording creating the Pivot table facing this yellow highlighted msg!
 

Attachments

  • Capture.JPG
    Capture.JPG
    81.5 KB · Views: 21
Can i share my excel sheet with you is possible I'm not find any link where i can upload it here
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
At the beginning you have PivotTable1 and then you refer to PivotTable2, I suppose that PivotTable2 does not exist.

1592670284893.png
 
Upvote 0
At the beginning you have PivotTable1 and then you refer to PivotTable2, I suppose that PivotTable2 does not exist.

View attachment 16669
I have recorded macros while creating pivot table 1 and then i copy same pivot and paste on different column and made some changes here and stop recording what does it mean i have 1 pivot 2 two ?
 
Upvote 0
Cross posted Facing problem in creating 2 pivot table in macros!

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,215,606
Messages
6,125,800
Members
449,261
Latest member
Rachel812321

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