Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Pivot table code help

When changing the cell values it changes the page filter for the OLAP
pivottable.
I can select the date i want, but it will not clear the previous selection.
So far any code i have tried has either not worked or resulted in an error,
or selected all the dates and jumped out of the code without returning an
error. Any Idea's ?

Dim YTEMP As String 'Year
Dim MTEMP As String 'Month
Dim DTEMP As String ' Day
Dim str As String
Dim str2 As String
Dim str3 As String

str = Sheets("Days").Range("H1").Value
str2 = Sheets("Days").Range("H2").Value 'Get values fron cell range
str3 = Sheets("Days").Range("H3").Value

YTEMP = str
MTEMP = str2 'Store Variables to holders
DTEMP = str3

'Apply filter
ActiveSheet.PivotTables("DAYSA").PivotFields("[Date]").AddPageItem _
"[Date].[All].[" & YTEMP & "].[" & MTEMP & "].[" & DTEMP & "]"

Thanks EI
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 Code FA Excel Discussion (Misc queries) 6 October 11th 05 04:03 PM
Pivot Table Code Martin Excel Programming 5 May 17th 05 03:43 PM
VBA Code for a pivot table to open database and to reference table current page Pete Straman Straman via OfficeKB.com Excel Programming 0 February 21st 05 03:57 AM
vba code for Pivot Table Paul Excel Programming 0 May 31st 04 05:04 AM
HELP! Code for Pivot Table Sandy[_3_] Excel Programming 6 September 3rd 03 09:43 PM


All times are GMT +1. The time now is 10:19 AM.

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"