View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default default pivottable page filter when parameter not present

In my experience, you can "corrupt" your table by making such erroneous
assignments. I would loop through the items in the Pivotfield/pagefield and
insure the item exists before I try to make the assignment. I generally
then make the assignment using the value of the pivotitem rather than a cell
or variable containing that value.

--
Regards,
Tom Ogilvy


"klysell" wrote:

Hi

My problem occurs when I run a macro to update pivot tables when new
data has been populated into the underlying records.

When the data records don't contain my reporting parameter during a
particular week, my macro will default the page filter to "All" (or some
other parameter) and not to the reporting parameter required since it is not
present in this week's data. The problem arises when I run the macro during
the following week and my reporting parameter is once again present in the
data set. Since my page filter was pegged at "All" the previous week, it will
not return to my targed paramater but will stay at "All". How do I
programmatically peg my page filter to my reporting parameter even when the
data parameter isn't present in data set? Instead of showing my parameter
when it isn't present in the data set, perhaps it can read "no data" or
something like this...

Thanks in advance,

--
Kent Lysell
Financial Consultant
Ottawa, Ontario
W: 613.943.9098