Mac Excel Won't Filter By Name Pivot Manual

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.
  1. Mac Excel Won't Filter By Name Pivot Manual Download
  2. Mac Excel Won't Filter By Name Pivot Manual Free
  3. 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.

Active3 years, 1 month ago

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.

Name

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?

Community
user1283776user1283776
4,19421 gold badges64 silver badges132 bronze badges

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.

savyuksavyuk

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

whytheqwhytheq
20.5k47 gold badges130 silver badges230 bronze badges

You 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.

MAFMAF

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.

BrettvenkerBrettvenker

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.

user3357094user3357094

In Excel 2007 onwards, you can use the much simpler code as follows:

Mac Excel Won't Filter By Name Pivot Manual Download

ghostJagoghostJago

Mac Excel Won't Filter By Name Pivot Manual Free

2,2534 gold badges28 silver badges47 bronze badges

Mac Excel Won't Filter By Name Pivot Manual Software

protected by CommunityJul 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?

Not the answer you're looking for? Browse other questions tagged excel-vbafilterpivot-tablevbaexcel or ask your own question.