Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default parameter and macro driven pivot table filter?

***Originally posted rather sloppily to general questions, but this is more
appropriate here i think.

I am trying to create a pivot table report based on start date and end date
parameters set by the end user. It will produce a report for a given period
of time, by month. Parameters will define the filter in attribute "End
Month-Year" of the pivot table.
I've gotten as far as list boxes that allow defining of 4 names for the the
start and
end dates: BegMo, BegYr, EndMo, EndYr and I have my data attribute "End
Month-Year" (End in this latter case refers to the end dates of contracts or
projects, which is what I am reporting on) in the pivot table. The following
code allows me to select the two start and end dates defined in the pivot
table filter, but it fails to do two things:
a) Remove previously selected values in "End Month-Year" pivot table attribute
and
b) set "End Month-Year" to select all values between "BegMo & BegYr" and
"EndMo & EndYr"

My macro looks like this:

BegMo = Range("E1")
BegYr = Range("F1")
EndMo = Range("G1")
EndYr = Range("H1")

Set pvtTable = Worksheets("Projection Summary").Range("D13").PivotTable

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("End Month-Year")
.PivotItems(BegMo & " " & BegYr).Visible = True

ActiveSheet.PivotTables("PivotTable1").PivotFields ("End Month-Year")
.PivotItems(EndMo & " " & EndYr).Visible = True

End With

.....

The good news is I am able to interact with my values in "End Month-Year" by
referencing concatenated "BegMo" and "BegYr", so at least that works.

Help with this?

Thanks,
Ryan

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 lines with Pivot table and non pivot table columns Grover Charts and Charting in Excel 4 September 28th 07 03:16 AM
Filter lines with Pivot table and non Pivot table columns Grover Excel Discussion (Misc queries) 1 September 26th 07 12:48 AM
Filter lines containing pivot table and non pivot table data Grover Excel Worksheet Functions 0 September 24th 07 07:20 PM
Linking parameter query from Access to pivot table in Excel ken1975 Excel Discussion (Misc queries) 2 June 20th 06 01:51 PM
Pivot Table From Access Parameter Query Paul Smith[_4_] Excel Programming 1 January 13th 05 04:04 PM


All times are GMT +1. The time now is 11:59 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"