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!
 

Some videos you may like

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.

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
 

Watch MrExcel Video

Forum statistics

Threads
1,118,168
Messages
5,570,645
Members
412,335
Latest member
cinciri99
Top