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
 
Marshalls said:
Right sorry i didnt see that, anyways i ran the code and get a blank message box with the ok button.

What do you get with:

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.SourceName & vbCrLf 
   Next PItem 
   MsgBox Msg 
End Sub
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
This is a macro i made to get an idea of the code:

Sub changeworks()

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 2]"
Sheets("Sheet1").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
End Sub


This is specific though to change from one machine to antoher as you can see there is muliple works ect ect.

Dont know if that help?
 
Upvote 0
Marshalls said:
exactly the same thing

I think I'm stuck then. Last possibility:

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.Value & vbCrLf 
   Next PItem 
   MsgBox Msg 
End Sub
 
Upvote 0
Ok thanks anyway Andrew and do you know if there is a control i can use to replicate the one on the pivot table where you can drill down into specific regions,sites ect ect
 
Upvote 0
Andrew,

I put my EXCEL file in a WEBSITE.
When I click the COMBOBOX, the following message appear:

"Unable to set the _Default property of the PivotItem class"

Any idea about what is the problem ?

Best regards,


HS
 
Upvote 0

Forum statistics

Threads
1,223,922
Messages
6,175,384
Members
452,639
Latest member
RMH2024

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