• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Pivot Table (Deselect and select)

ianb

Member
Hi,


I would like to know if a person has a program that can select only a select items in a pivot table.


I would like to show select memebers of a team in a pivot table when i run a macro.

I have 3 teams to show.


Below is my first and second attempt ?


Each team has for example 5 members so I need to deselect all and add 5 members.


Any Ideas ? or Prgrams welcome. Last attempt removes all except blank and I can not add members.


Sub PivotSelectTeam1()

'

'Sheets("Dashboard (Individual)").Select

'

' With ActiveSheet.PivotTables("PivotTable9").PivotFields("Individual+")

' On Error Resume Next

' .PivotItems("Name1").Visible = True

' .PivotItems("Name2").Visible = True

' .PivotItems("(Blank)").Visible = True

' On Error GoTo 0

' End With

'

'End Sub


Dim oPI As PivotItem


On Error Resume Next


For Each oPI In ActiveSheet.PivotTables("PivotTable9").PivotFields("Individual+").PivotItems

oPI.Visible = False

Next oPI


End Sub
 
Hello ianb,


Can you plz download the file from here and let us know if this is what something you are looking for?


http://speedy.sh/wDMJf/Pivot-update.xlsm


Kaushik
 
Hi, Thanks for the reply. I am trying to create a basic account and can not find this screen.


do you have anotehr means of uploading the data. e.g. via this web site.
 
Hi, SOrry about this yet does any one know the answer to this as I can not gain an account at speedy.


Any program would give me an understanding. thanks....
 
Hi Ian ,


Quite a few of us ( I certainly ) prefer SpeedyShare ( http://speedy.sh/ ) because the site does not require you to register either to upload or to download files.


Just click on the link which Kaushik has given , and you will see the following on the screen :


Download: Pivot update.xlsm 20.14 KB


Click on the file name , and save it to your computer.


Narayan
 
I will try again. it was asking for me to set up an account. I will try again just clicking on the link and then clicking on the file name. thank you.
 
Hi,


I am at work and this location is blocked ?


Can any one upload the code for me here or copy and paste it please.


Thanks.
 
Hi Ian ,


The code itself is just one line ! Two range names have been defined ; why don't you specify the file-sharing website which you can access , and I'll upload Kaushik's file to that site , if possible ?


Narayan
 
Thanks for the assistance they are all blocked here at work. I will look when I go home.


I am sure t is a simple answer. Just having one of those days. I can remove multi items from a pivot via a vba script yet can not select. visiable = true does not work for me.


Many thanks for you time to assist hopefully all ok this evening when i go home.
 
Hello ianb,


As Narayan rightfully said that speedy share does not require any account to be created, just try to download the file once you are at home. I am sure you will be able to download the file. In case you still can not download the file even from your home network, let me know your e-mail ID, I will send the workbook to the same.


Kaushik
 
Thanks Alot kaushik and narayan for your time. I will wait until I go home and try again by just clickng on the link. where I work is a secure zone so I only have a few hours before I go home. must be such a simple answer to this with two lines as I have tried various methods the last was over 50 lines long !!!! many thanks again. Ian.
 
Back
Top