Hi,
I have a simple pivot table:
source data
ID name date
1 name1 12.1.2013
2 name2 14.1.2013
3 name3 13.1.2013
My Pivot table is only meant for sorting (filetring etc.) the data according to the date. There are no 'values'.
Desired result
ID name date
1 name1 12.1.2013
3 name3 13.1.2013
2 name2 14.1.2013
But it won't work. The button indicates a sorted column, but the order is still 1,2,3 instead of 1,3,2.
The source data 'date' column is formatted as date.
Excel 2010.
Thanks for any suggestions.
- Mac Excel Won't Filter By Name Pivot Manual Download
- Mac Excel Won't Filter By Name Pivot Manual Free
- Mac Excel Won't Filter By Name Pivot Manual Software
You won’t be able to create new slicers in Excel for the web. To filter your PivotTable data, do one of the following: To apply a manual filter, click the arrow on Row Labels or Column Labels, and then pick the filtering options you want. If your PivotTable has slicers, just click the items you want to show in each slicer. You won’t be able to create new slicers in Excel for the web. To filter your PivotTable data, do one of the following: To apply a manual filter, click the arrow on Row Labels or Column Labels, and then pick the filtering options you want. By: Dennis Taylor. But suppose you have a great pivot table layout and want to filter the pivot table using the values in a field that doesn't appear within that arrangement. For example, you might want to filter monthly sales data by quarter but without having the quarter field change the pivot table's layout.
I have tried copying and pasting solutions from the internet forever now to try to filter a pivot table in Excel using VBA. The code below doesn't work.
I want to filter so I see all rows that have SavedFamilyCode K123223. I don't want to see any other rows in the pivot table. I want this to work regardless of the previous filters. I hope you can help me with this. Thanks!
Based on your post I'm trying:
Unfortunately I get Run time error 91: Object variable or With block variable not set. What has caused this error?
6 Answers
Field.CurrentPage only works for Filter fields (also called page fields).
If you want to filter a row/column field, you have to cycle through the individual items, like so:
Then, you would just call:
Naturally, this gets slower the more there are individual different items in the field. You can also use SourceName instead of Name if that suits your needs better.
Configure the pivot table so that it is like this:
Your code can simply work on range('B1') now and the pivot table will be filtered to you required SavedFamilyCode
whytheqwhytheqYou could check this if you like. :)
Use this code if SavedFamilyCode is in the Report Filter:
But if the SavedFamilyCode is in the Column or Row Labels use this code:
Hope this helps you.
I think i am understanding your question. This filters things that are in the column labels or the row labels. The last 2 sections of the code is what you want but im pasting everything so that you can see exactly how It runs start to finish with everything thats defined etc. I definitely took some of this code from other sites fyi.
Near the end of the code, the 'WardClinic_Category' is a column of my data and in the column label of the pivot table. Same for the IVUDDCIndicator (its a column in my data but in the row label of the pivot table).
Hope this helps others...i found it very difficult to find code that did this the 'proper way' rather than using code similar to the macro recorder.
Latest versions of Excel has a new tool called Slicers. Using slicers in VBA is actually more reliable that .CurrentPage (there have been reports of bugs while looping through numerous filter options). Here is a simple example of how you can select a slicer item (remember to deselect all the non-relevant slicer values):
There are also services like SmartKato that would help you out with setting up your dashboards or reports and/or fix your code.
In Excel 2007 onwards, you can use the much simpler code as follows:
Mac Excel Won't Filter By Name Pivot Manual Download
ghostJagoghostJagoMac Excel Won't Filter By Name Pivot Manual Free
Mac Excel Won't Filter By Name Pivot Manual Software
protected by Community♦Jul 6 '16 at 1:30
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?