Pivot Tables: Page field in a Combobox in another worksheet

hsalortb

New Member
Joined
Jul 6, 2005
Messages
12
Hi,

How can I put (or control) a PAGE FIELD of a Pivot Table in another worksheet in the same MS Excel workbook.

Thanks.

HS
 
Hope this is what you mean,

this is the pivot table
xmr shift.xls
ABCD
3AllWorkcentresStIvesPress2
4
5UnplannedDownTime
6DateShiftDescTotal
704/01/2005Days12Hour2731
8Nights12Hour971
905/01/2005Days12Hour1212
10Nights12Hour422
1106/01/2005Days6-3463
1210/01/2005Days12Hour2524
13Nights12Hour6904
1411/01/2005Days12Hour6275
15Nights12Hour1965
1612/01/2005Days12Hour2686
17Nights12Hour1126
1813/01/2005Days6-3427
19Nights12Hour237
2017/01/2005Days12Hour2198
21Nights12Hour3088
2218/01/2005Days12Hour3959
23Nights12Hour2429
2419/01/2005Days12Hour23710
25Nights12Hour9710
2620/01/2005Days12Hour5011
27Nights12Hour7911
2824/01/2005Days12Hour29812
29Nights12Hour34312
PivotTable



Also i did a macro changing the field i want to change from one machine to the other and this is some of the code i got

Sheets("PivotTable").Select
ActiveSheet.PivotTables("Downtime").PivotFields("[All Workcentres]"). _
CurrentPageName = _
"[All Workcentres].[All Workcentres].[Landscape & Walling].[Marshalls L&W].[Southern].[RV - St Ives].[St Ives Flag and kerb dept.].[St Ives Press 1]"
Sheets("Sheet1").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh

Also the combobox on the pivot table is grouped does this make a difference if so how can i replicate that?
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I'm a bit stuck, because I am not familiar with the square bracket and dot syntax in:

Code:
ActiveSheet.PivotTables("Downtime").PivotFields("[All Workcentres]"). _ 
CurrentPageName = _ 
"[All Workcentres].[All Workcentres].[Landscape & Walling].[Marshalls L&W].[Southern].[RV - St Ives].[St Ives Flag and kerb dept.].[St Ives Press 1]"

My code was for a simple ungrouped Page Field.

If you run this, what do you get?

Code:
Sub Test()
   Dim PItem As PivotItem
   Dim Msg As String
   For Each PItem In ActiveSheet.PivotTables("Downtime").PivotFields("[All Workcentres]").PivotItems
      Msg = Msg & PItem.Name & vbCrLf
   Next PItem
   MsgBox Msg
End Sub
 
Upvote 0
Hi,

I did make the copy of the fields from a PIVOT TABLE to a new worksheet, and I could add new fields, incoporating new formulas, and, also, with the Andrew help (PIVOT FIELDS code in COMBOBOX) I can control the data in this new worksheet, making a selection through the COMBOBOXES (I'm using more of one) that make filtering over the original data at the PIVOT TABLE.

The idea is that new worksheet is like a "mirror" of the PIVOT TABLE (located in the same workbook but in another worksheet). In this "mirror" I can manage the data with more flexibility than in the PIVOT TABLE, but I maintain the connection with the external database and also the data processing features of the PIVOT TABLE.

However, I don't know how to transfer from the PIVOT TABLE to the new worksheet, some features of the PIVOT TABLE, like row formats (font, lines) and pake breaks after selected subtotals.

Could you please help me with this issue ?


Thanks in advance.


HS


[/img]
 
Upvote 0
Hi Andrew if i run that code i get this error

Run-Time error '1004':

Application-defined or object-defined error
 
Upvote 0
On what line do you get that error? Is the PivotTable on the ActiveSheet?

It's going to be difficult for me to test any code I write because I don't have an OLAP data source.
 
Upvote 0

Forum statistics

Threads
1,223,920
Messages
6,175,377
Members
452,638
Latest member
Oluwabukunmi

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