Pivot table manipulation

bigj4155

Board Regular
Joined
Mar 3, 2005
Messages
187
Hello everyone!

I have one again that is just stumping me. I am slowly getting better with VBA but I am not yet a jedi master like some :)

Not to make this to complicated on what I am trying to do, I will just explain the basics of what I am wanting.

I have a pivot table on sheet "Consolidate" this pivot table reads from a database file "consolidatereport.mbd" On the pivot table its main sorter is a part number. It then branches out into various information on the part number ect...

All I really want to happen is that when I click a button it reads a list of part numbers from a sheet in the same workbook. Then alters the pivot table to ONLY show the part number listed on this sheet.

Now this part list will be dynamic, ranging from 1 part number to hundreds.

Part list will be contained on sheet "partlist", parts will be listed in A column and again the pivot table is on sheet "consolidate"

I have went through macro recorder but it gives me a..... less than... ya it just doesnt return a usuable code :)

Thanks in advance like always!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
You need to doubleclick the field header and *hide* items.

Recording a macro will give code something like this :-
Code:
    With ActiveSheet.PivotTables("PivotTable1").PivotFields("part")
        .PivotItems("2").Visible = False
        .PivotItems("3").Visible = False
    End With
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,055
Messages
5,835,157
Members
430,342
Latest member
Sailingexcel

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
Top