Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the below code and getting a error (Pivot Table name not valid) when
the code is ran Sub CreatePivotTables() Dim LastRow As Long Worksheets.Add.Name = "Receiving TAT" Worksheets.Add.Name = "Screening TAT" Sheets("HP Defective Receipts in SPL ma").Select LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "'HP Defective Receipts in SPL ma'!R1C22:R" & LastRow).CreatePivotTable _ TableDestination:=Range("A1"), TableName:="PivotTable1" ActiveSheet.PivotTables("PivotTable1").SmallGrid = False ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Receiving TAT" With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Receiving TAT") .Orientation = xlDataField .Calculation = xlPercentOfColumn End With Charts.Add ActiveChart.SetSourceData Source:=Sheets("Receiving TAT").Range("A1") ActiveChart.Location Whe=xlLocationAsNewSheet End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to create pivot table from existing pivot table in excel 2007 | Excel Discussion (Misc queries) | |||
Copying values from pivot table to cells outside pivot table | Excel Discussion (Misc queries) | |||
Filter lines with Pivot table and non pivot table columns | Charts and Charting in Excel | |||
How do I create a pivot table if the pivot table icon or menu ite. | Charts and Charting in Excel | |||
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" | Excel Programming |