Question on pivot tables

D

Daniel Bonallack

Let's say a pivot table has two fields - "country" and "fruit". There are
seven products and seven countries, and I want to flip through all 49
permutations.

However, if one product isn't present in one country (for example, let's say
"apple" does not exist in "england"), then rather than returning the error,
the vba code forces "apple" over the top of another fruit that does exist.
So the code firstly selects "england", then (if I were doing it manually) I
would drop down the fruit box and see that "apple" wasn't present. But the
code basically screws the pivot table.

My horrible workaround is to go to the raw data and filter on "England" and
"Apple", and (seeing no rows returned), I would skip this combination when
flipping the pivot.

There must be a better way...

Thanks in advance
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top