Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro and Pivot tables using a CUBE as data source
I'm using several pivot tables all driven from the same Cube. All tables are
using the same field to filter on [MAJOR TERMINAL CODE-NAME]. The task is to create a macro that will read the first filter, then copy that value to the other tables. Problem, the Cube field [MAJOR TERMINAL CODE-NAME] contains two columns, (one text, one numeric), but only one is visible. When recording the field with mouse clicks it clearly captures the two values in the macro code. However, when I try to use ActiveCell.PivotCell.Range.Value only the first column gets captured to my variable. Here is my code: pivotchoice = ActiveCell.PivotCell.Range.Value pivotcode = "[BOOKING AGENCY].[BOOKING AGENCY-MAJOR].&[" & pivotchoice & "]" ActiveSheet.PivotTables("Agent Total").PivotFields( _ "[BOOKING AGENCY].[BOOKING AGENCY-MAJOR].[MAJOR TERMINAL CODE-NAME]"). _ CurrentPageName = pivotcode Any idea how to capture both columns to the variable pivotchoice -- Ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot tables - Editing the data source shared by multiple pivot ta | Excel Discussion (Misc queries) | |||
Data Source in Pivot Tables | Charts and Charting in Excel | |||
Identifying Source Data for Pivot Tables | Excel Discussion (Misc queries) | |||
Source Data in Pivot Tables | Excel Worksheet Functions | |||
Pivot Table data source "data source contains no visible tables" | Excel Worksheet Functions |