Hi everyone(:
I'm having trouble creating pivot tables using macros.
First i tried recording it then running the exact same thing. It worked fine the first time but a week later when i tried it again the pivot table failed me. As i am using raw data as the data source, hence the number of rows changes everyday and therefore the datasource for the pivot table code cannot be fixed.
How do i do this?
ActiveWorkbook. PivotCaches.Add (SourceType:=xl Database, SourceData:= _
"'Raw Data'!R1C1:R511 C30").CreatePivotT able TableDestinatio n:= _
"'[Consolidated Report.xls]Table'!R22C3", TableName:="Piv otTable1", _
DefaultVersion: =xlPivotTableVe rsion10
Also highlighted in my raw data are exceptions. For example the record that is incompleted for customer A is highlighted in red. However after my pivot table is created when i click to view the records for Customer A, non of the trades are highlighted.
Please advise(: many thanks for all the help and effort.
Have a great day ahead and have a blast!
Cheers!
Nicole
I'm having trouble creating pivot tables using macros.
First i tried recording it then running the exact same thing. It worked fine the first time but a week later when i tried it again the pivot table failed me. As i am using raw data as the data source, hence the number of rows changes everyday and therefore the datasource for the pivot table code cannot be fixed.
How do i do this?
ActiveWorkbook. PivotCaches.Add (SourceType:=xl Database, SourceData:= _
"'Raw Data'!R1C1:R511 C30").CreatePivotT able TableDestinatio n:= _
"'[Consolidated Report.xls]Table'!R22C3", TableName:="Piv otTable1", _
DefaultVersion: =xlPivotTableVe rsion10
Also highlighted in my raw data are exceptions. For example the record that is incompleted for customer A is highlighted in red. However after my pivot table is created when i click to view the records for Customer A, non of the trades are highlighted.
Please advise(: many thanks for all the help and effort.
Have a great day ahead and have a blast!
Cheers!
Nicole
Comment