largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Hi,
I have a userform and I would like to update a pivot table based on selected checkboxes.
So I have some code which will edit the pivot table:
What I'd like to do is create an array to use with this and fill it based on whether a checkbox is selected. So if I have Name, ID, and Age checkboxes, I'd like to be able to select Name and age and then have the array be ("Name", "Age").
Also, I don't know how I could make the ShowDetail = False, since I won't know whether or not a field has been selected. Is it possible to just loop through all the rowfields (except for the last one) and say for each one to set showdetail = false?
Sorry I know that's 2 questions.
Thanks for any insight or ideas.
I have a userform and I would like to update a pivot table based on selected checkboxes.
So I have some code which will edit the pivot table:
Code:
ActiveSheet.PivotTables("Table1").AddFields RowFields:= Array("Name","ID","Age")
ActiveSheet.PivotTables("Table1").RowFields("Name").ShowDetail = False
ActiveSHeet.PivotTables("Table1").RowFields("ID").ShowDetail = False
What I'd like to do is create an array to use with this and fill it based on whether a checkbox is selected. So if I have Name, ID, and Age checkboxes, I'd like to be able to select Name and age and then have the array be ("Name", "Age").
Also, I don't know how I could make the ShowDetail = False, since I won't know whether or not a field has been selected. Is it possible to just loop through all the rowfields (except for the last one) and say for each one to set showdetail = false?
Sorry I know that's 2 questions.
Thanks for any insight or ideas.
Last edited: