Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default default pivottable page filter when parameter not present

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default default pivottable page filter when parameter not present

Hi Tom,

Thanks for your reply. In regards to looping through pivotitems for the page
filter: How would I accomplish this when I have one of six possible values
for this parameter? These values are "SP230", "SP231", "SP232", "SP233",
"SP234", and "SP235", and there is an attendant pivot table for each. What if
the pivot table for SP230 doesn't contain any values for this parameter in
the current week but will in the next week? I'm still a newbie when it comes
to coding, but manage to patch together code that seems to work. I'll look in
the postings for a looping example, but is still doesn't allow me to choose a
"dummy" parameter when my required parameter isn't present.... I would like
to minimize human intervention in having to re-select the page filter from
"All" or "Blank" in the current week to "SP230" in the next week when my
parameter returns to the data set...

Regards,

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


"Tom Ogilvy" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter PivotTable dropdown items to match report filter Catherine D Excel Discussion (Misc queries) 1 August 16th 08 12:12 AM
parameter and macro driven pivot table filter? Ryan Hartnett Excel Programming 0 October 25th 06 09:26 PM
Print Pivottable - show all selected items in page filter Koen Excel Discussion (Misc queries) 0 June 19th 06 09:30 AM
I want to present and excel document on a .aspx page Nery Excel Programming 1 October 20th 04 05:25 AM
How do I change a function's otional parameter default values programmically Michael[_21_] Excel Programming 5 October 24th 03 09:22 PM


All times are GMT +1. The time now is 03:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"