Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Expert Needed!!!!!!!!!! Pivot problem

hi im trying to automate a selection for date on all my pvot tables. i have
these pivots that are joined by an olap cube to my workbook. what i have done
is create diffrent tables for diffrent measures but i have one constant and
this is Date. im trying to create a user form which selects from a list the
months required for viewing.
eg March april May, 2006

these selections are fed into arrays as strings like
[Time].[Months].[All Time].[2006].[Quarter 3 2006].[July 2006]
i understand that with the Date field it requires a hide method for the
months not selected.

this is my code so far


ActiveSheet.PivotTables("PivotTable1").CubeFields( 44).TreeviewControl.Drilled
_
= Array(Array(""), array(showyear)), showquart)

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Year]").
_
HiddenItemsList = Array(notyear)

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Quarter]") _
.HiddenItemsList = notquart()

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Month]"). _
HiddenItemsList = array(notmonth)

all the Arrays are previously set into strings on the workbook but the pivot
will not read my arrays as normal it comes up with errors and will not change
anything.

hope this reads alright

if anyones got a sample code that would be excellant!!!!!
i just want to be able to auto change 30 pivot tables to the date i chose in
a user format the start! sounds simple but as i found out, not so!

please help

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Expert Needed!!!!!!!!!! Pivot problem

You could create an array from the list, instead of a string. Then, make
the HiddenItemsList equal to the array.

rivers wrote:
hi im trying to automate a selection for date on all my pvot tables. i have
these pivots that are joined by an olap cube to my workbook. what i have done
is create diffrent tables for diffrent measures but i have one constant and
this is Date. im trying to create a user form which selects from a list the
months required for viewing.
eg March april May, 2006

these selections are fed into arrays as strings like
[Time].[Months].[All Time].[2006].[Quarter 3 2006].[July 2006]
i understand that with the Date field it requires a hide method for the
months not selected.

this is my code so far


ActiveSheet.PivotTables("PivotTable1").CubeFields( 44).TreeviewControl.Drilled
_
= Array(Array(""), array(showyear)), showquart)

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Year]").
_
HiddenItemsList = Array(notyear)

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Quarter]") _
.HiddenItemsList = notquart()

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Month]"). _
HiddenItemsList = array(notmonth)

all the Arrays are previously set into strings on the workbook but the pivot
will not read my arrays as normal it comes up with errors and will not change
anything.

hope this reads alright

if anyones got a sample code that would be excellant!!!!!
i just want to be able to auto change 30 pivot tables to the date i chose in
a user format the start! sounds simple but as i found out, not so!

please help



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Expert Needed!!!!!!!!!! Pivot problem

hi debra
I had already tried hiddenitemlist = showquart()
but this caused an error saying type miss match
and then tried
hiddenitemlist = Array(showquart)
which then gave a ore encouraging error
items were not found on OLAP cube


any idea?

"Debra Dalgleish" wrote:

You could create an array from the list, instead of a string. Then, make
the HiddenItemsList equal to the array.

rivers wrote:
hi im trying to automate a selection for date on all my pvot tables. i have
these pivots that are joined by an olap cube to my workbook. what i have done
is create diffrent tables for diffrent measures but i have one constant and
this is Date. im trying to create a user form which selects from a list the
months required for viewing.
eg March april May, 2006

these selections are fed into arrays as strings like
[Time].[Months].[All Time].[2006].[Quarter 3 2006].[July 2006]
i understand that with the Date field it requires a hide method for the
months not selected.

this is my code so far


ActiveSheet.PivotTables("PivotTable1").CubeFields( 44).TreeviewControl.Drilled
_
= Array(Array(""), array(showyear)), showquart)

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Year]").
_
HiddenItemsList = Array(notyear)

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Quarter]") _
.HiddenItemsList = notquart()

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Months].[Month]"). _
HiddenItemsList = array(notmonth)

all the Arrays are previously set into strings on the workbook but the pivot
will not read my arrays as normal it comes up with errors and will not change
anything.

hope this reads alright

if anyones got a sample code that would be excellant!!!!!
i just want to be able to auto change 30 pivot tables to the date i chose in
a user format the start! sounds simple but as i found out, not so!

please help



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Expert Needed!!!!!!!!!! Pivot problem

You said that "these selections are fed into arrays as strings". I
suggested creating an array from the list on the user form, instead of a
string. Did you try that?

Then, .hiddenitemlist=showquart should work.

rivers wrote:
hi debra
I had already tried hiddenitemlist = showquart()
but this caused an error saying type miss match
and then tried
hiddenitemlist = Array(showquart)
which then gave a ore encouraging error
items were not found on OLAP cube


any idea?

"Debra Dalgleish" wrote:


You could create an array from the list, instead of a string. Then, make
the HiddenItemsList equal to the array.

rivers wrote:

hi im trying to automate a selection for date on all my pvot tables. i have
these pivots that are joined by an olap cube to my workbook. what i have done
is create diffrent tables for diffrent measures but i have one constant and
this is Date. im trying to create a user form which selects from a list the
months required for viewing.
eg March april May, 2006

these selections are fed into arrays as strings like
[Time].[Months].[All Time].[2006].[Quarter 3 2006].[July 2006]
i understand that with the Date field it requires a hide method for the
months not selected.

this is my code so far


ActiveSheet.PivotTables("PivotTable1").CubeFiel ds(44).TreeviewControl.Drilled
_
= Array(Array(""), array(showyear)), showquart)

ActiveSheet.PivotTables("PivotTable1").PivotFie lds("[Time].[Months].[Year]").
_
HiddenItemsList = Array(notyear)

ActiveSheet.PivotTables("PivotTable1").PivotFie lds("[Time].[Months].[Quarter]") _
.HiddenItemsList = notquart()

ActiveSheet.PivotTables("PivotTable1").PivotFie lds("[Time].[Months].[Month]"). _
HiddenItemsList = array(notmonth)

all the Arrays are previously set into strings on the workbook but the pivot
will not read my arrays as normal it comes up with errors and will not change
anything.

hope this reads alright

if anyones got a sample code that would be excellant!!!!!
i just want to be able to auto change 30 pivot tables to the date i chose in
a user format the start! sounds simple but as i found out, not so!

please help



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Expert Needed!!!!!!!!!! Pivot problem

i have a data source which links to my sheet via a pivot table. on this pivot
table is the Date range the date starts at january 2005-present what i
require if its possible to minipulate the pivot tables to automatically
select may 2006 -July 2006 from list box.

can you send me some sample code if its posssible please because im not an
expert in pivot tables and dont no really how to start.

(my previouse code was created from a macro but the string of selections was
changed to strings gained from arrays (variants) which were linked to a
worksheet that worked them out from the selection made in the list)

"Debra Dalgleish" wrote:

You said that "these selections are fed into arrays as strings". I
suggested creating an array from the list on the user form, instead of a
string. Did you try that?

Then, .hiddenitemlist=showquart should work.

rivers wrote:
hi debra
I had already tried hiddenitemlist = showquart()
but this caused an error saying type miss match
and then tried
hiddenitemlist = Array(showquart)
which then gave a ore encouraging error
items were not found on OLAP cube


any idea?

"Debra Dalgleish" wrote:


You could create an array from the list, instead of a string. Then, make
the HiddenItemsList equal to the array.

rivers wrote:

hi im trying to automate a selection for date on all my pvot tables. i have
these pivots that are joined by an olap cube to my workbook. what i have done
is create diffrent tables for diffrent measures but i have one constant and
this is Date. im trying to create a user form which selects from a list the
months required for viewing.
eg March april May, 2006

these selections are fed into arrays as strings like
[Time].[Months].[All Time].[2006].[Quarter 3 2006].[July 2006]
i understand that with the Date field it requires a hide method for the
months not selected.

this is my code so far


ActiveSheet.PivotTables("PivotTable1").CubeFiel ds(44).TreeviewControl.Drilled
_
= Array(Array(""), array(showyear)), showquart)

ActiveSheet.PivotTables("PivotTable1").PivotFie lds("[Time].[Months].[Year]").
_
HiddenItemsList = Array(notyear)

ActiveSheet.PivotTables("PivotTable1").PivotFie lds("[Time].[Months].[Quarter]") _
.HiddenItemsList = notquart()

ActiveSheet.PivotTables("PivotTable1").PivotFie lds("[Time].[Months].[Month]"). _
HiddenItemsList = array(notmonth)

all the Arrays are previously set into strings on the workbook but the pivot
will not read my arrays as normal it comes up with errors and will not change
anything.

hope this reads alright

if anyones got a sample code that would be excellant!!!!!
i just want to be able to auto change 30 pivot tables to the date i chose in
a user format the start! sounds simple but as i found out, not so!

please help



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Expert Needed!!!!!!!!!! Pivot problem

You'd have to adapt this to your data and userform, but with a list box
(named lstQtr) that shows quarters, e.g.:

[2003].[1]
[2003].[2]
[2003].[3]

The following code would hide the unselected items in each pivot table
in the workbook:

'========================
Private Sub cmdOK_Click()
Dim lQtr As Long
Dim myArray() As Variant
Dim ws As Worksheet
Dim lItems As Long
Dim lCount As Long
Dim pt As PivotTable
Dim lSel As Long

Me.Hide

lItems = 0

'count the unselected items -- these will be hidden
With Me.lstQtr
For lQtr = 0 To .ListCount - 1
If .Selected(lQtr) = False Then
lItems = lItems + 1
End If
Next lQtr
End With

ReDim myArray(0 To lItems - 1)

With Me.lstQtr
lSel = 0
For lCount = 0 To .ListCount - 1
If .Selected(lCount) = False Then
myArray(lSel) = "[Period].[All]." & .List(lCount)
lSel = lSel + 1
End If
Next lCount
End With

For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
With pt
.PivotFields("[Period].[Year]").HiddenItemsList = Array("")
.PivotFields("[Period].[Quarter]").HiddenItemsList = Array("")
.PivotFields("[Period].[Quarter]").HiddenItemsList = myArray
End With
Next pt
Next ws

Unload frmHideItems

End Sub
'=====================

rivers wrote:
i have a data source which links to my sheet via a pivot table. on this pivot
table is the Date range the date starts at january 2005-present what i
require if its possible to minipulate the pivot tables to automatically
select may 2006 -July 2006 from list box.

can you send me some sample code if its posssible please because im not an
expert in pivot tables and dont no really how to start.

(my previouse code was created from a macro but the string of selections was
changed to strings gained from arrays (variants) which were linked to a
worksheet that worked them out from the selection made in the list)

"Debra Dalgleish" wrote:


You said that "these selections are fed into arrays as strings". I
suggested creating an array from the list on the user form, instead of a
string. Did you try that?

Then, .hiddenitemlist=showquart should work.

rivers wrote:

hi debra
I had already tried hiddenitemlist = showquart()
but this caused an error saying type miss match
and then tried
hiddenitemlist = Array(showquart)
which then gave a ore encouraging error
items were not found on OLAP cube


any idea?

"Debra Dalgleish" wrote:



You could create an array from the list, instead of a string. Then, make
the HiddenItemsList equal to the array.

rivers wrote:


hi im trying to automate a selection for date on all my pvot tables. i have
these pivots that are joined by an olap cube to my workbook. what i have done
is create diffrent tables for diffrent measures but i have one constant and
this is Date. im trying to create a user form which selects from a list the
months required for viewing.
eg March april May, 2006

these selections are fed into arrays as strings like
[Time].[Months].[All Time].[2006].[Quarter 3 2006].[July 2006]
i understand that with the Date field it requires a hide method for the
months not selected.

this is my code so far


ActiveSheet.PivotTables("PivotTable1").CubeFi elds(44).TreeviewControl.Drilled
_
= Array(Array(""), array(showyear)), showquart)

ActiveSheet.PivotTables("PivotTable1").PivotF ields("[Time].[Months].[Year]").
_
HiddenItemsList = Array(notyear)

ActiveSheet.PivotTables("PivotTable1").PivotF ields("[Time].[Months].[Quarter]") _
.HiddenItemsList = notquart()

ActiveSheet.PivotTables("PivotTable1").PivotF ields("[Time].[Months].[Month]"). _
HiddenItemsList = array(notmonth)

all the Arrays are previously set into strings on the workbook but the pivot
will not read my arrays as normal it comes up with errors and will not change
anything.

hope this reads alright

if anyones got a sample code that would be excellant!!!!!
i just want to be able to auto change 30 pivot tables to the date i chose in
a user format the start! sounds simple but as i found out, not so!

please help



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

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
Problem with VLOOKUP and pivot table LB79 Excel Discussion (Misc queries) 2 July 26th 06 02:28 PM
urgent solution needed to 'custom view' re-calculation problem! phil Excel Discussion (Misc queries) 1 July 5th 06 09:26 PM
Pivot Series problem Air-ron Charts and Charting in Excel 0 March 21st 06 04:06 AM
Pivot Table Data Filter Problem Pepikins Excel Discussion (Misc queries) 0 June 16th 05 09:12 AM
Problem with times in pivot tables and graphs [email protected] Excel Discussion (Misc queries) 2 February 23rd 05 06:59 AM


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