Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Just help me to make this pivot table macro DINAMIC (multiple values)

Status
Not open for further replies.

calded

Vendor
Aug 6, 2002
1
PE
Hi, i am new using VB for excel so i had some problems to make my programing sentences working for changing values.
Please help me to make better this sentence (takes to much time to excute) created to unselect all pivot items in a pivot table and then just select one pivot item stored in the varible X. Maybe exists some command like "PivotItems.(CeBe[All]).visible=True"

I'll appreciate any help.
Thanks in advance,
Daniel

Here is my sentences created with record macro

sub()
Dim x As String
x = Range("C10").Value
With ActiveSheet.PivotTables("CeCo").PivotFields("Descripción CeBe")
.PivotItems("(blank)").Visible = True
.PivotItems("E-Business").Visible = False
.PivotItems("FI").Visible = False
.PivotItems("GH").Visible = False
.PivotItems("Logística").Visible = False
End With
ActiveSheet.PivotTables("CeCo").PivotFields("Descripción CeBe").PivotItems(x).Visible = True
ActiveSheet.PivotTables("CeCo").PivotFields("Descripción CeBe").PivotItems("(blank)").Visible = False
end sub()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top