Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Selecting a range of values on pivot table attribute with a macro

Hi,

I wonder if someone can help me create variable nuumber of months pivot
table report based on start date and end date parameters set by the end user.
I've gotten as far as list boxes that define 4 names for the the start and
end dates: BegMo, BegYr, EndMo, EndYr and I have my data element "End
Month-Year" in the pivot table. The following code allows me to set the
table to the two start and end dates defined, but it fails to do two things:
a) remove other preset values in "End Month-Year"
and
b) set "End Month-Year" to select all values between "BegMo & BegYr" and
"EndMo & EndYr"

Help with this?

Ryan

--
Stanford Research Administration
Financial Management Analyst

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Selecting a range of values on pivot table attribute with a macro

Forgot to reference the offending code: ;^)

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



"Ryan Hartnett" wrote:

Hi,

I wonder if someone can help me create variable nuumber of months pivot
table report based on start date and end date parameters set by the end user.
I've gotten as far as list boxes that define 4 names for the the start and
end dates: BegMo, BegYr, EndMo, EndYr and I have my data element "End
Month-Year" in the pivot table. The following code allows me to set the
table to the two start and end dates defined, but it fails to do two things:
a) remove other preset values in "End Month-Year"
and
b) set "End Month-Year" to select all values between "BegMo & BegYr" and
"EndMo & EndYr"

Help with this?

Ryan

--
Stanford Research Administration
Financial Management Analyst

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
Pivot Table external XLS file source change and GETPIVOTDATA refresh mbobro Excel Discussion (Misc queries) 0 July 8th 06 12:45 PM
Using Pivot Table Values mgross Excel Discussion (Misc queries) 1 June 1st 06 09:40 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
Pivot Table - max rows allowed in data range dmotika Excel Discussion (Misc queries) 2 May 26th 05 05:52 PM


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