Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Changing pivot datasource by formulas?

 
   Windows Help (Home) -> Microsoft Excel RSS
Next:  Media Center Receiver Error  
Author Message
Snoopy

External


Since: Nov 7, 2008
Posts: 1



(Msg. 1) Posted: Tue Apr 28, 2009 1:08 am
Post subject: Changing pivot datasource by formulas?
Archived from groups: microsoft>public>excel (more info?)

Hi guys Smile
I not quite sure if there is any solution to this.
My last chance is to cry for help in this room of qualifications...
(aaaargh!!)

This monthly "cut-off" report of mine is based on one chosen dataset
(the last monthly) - placed in each sheet in my workbook; 09-Jan, 09-
Feb, 09-Mar ... and so on.
New month makes a new sheet, one dataset pr month / all sets with
identical columnheaders.

In the sheet "Montly Report" I have a pivot-table using the latest
monthly dataset.
My problem is that I have to manually change the pivot-dataset to
change report of one month to another.

In some other matters I make use of the formula expression: =CELLE
("filname";A1);6) to change sheet-references in formulas, but i think
this is not a possible option when using menudriven prosedure.

Yes I know I can make one big multi-month dataset, but there are some
options regarding conditional formats (among other issues) in the
dataset to allow for.

Is there any option to change the pivot-datasheet-reference by using
formulas? - or by using macros?

Expectant regards
Snoopy

 >> Stay informed about: Changing pivot datasource by formulas? 
Back to top
Login to vote
dheaton

External


Since: Apr 28, 2009
Posts: 1



(Msg. 2) Posted: Tue Apr 28, 2009 3:48 am
Post subject: Re: Changing pivot datasource by formulas?
Archived from groups: per prev. post (more info?)

On Apr 28, 6:08 pm, Snoopy wrote:
> Hi guys Smile
> I not quite sure if there is any solution to this.
> My last chance is to cry for help in this room of qualifications...
> (aaaargh!!)
>
> This monthly "cut-off" report of mine is based on one chosen dataset
> (the last monthly) -  placed in each sheet in my workbook; 09-Jan, 09-
> Feb, 09-Mar  ... and so on.
> New month makes a new sheet, one dataset pr month / all sets with
> identical columnheaders.
>
> In the sheet "Montly Report"  I have a pivot-table using the latest
> monthly dataset.
> My problem is that I have to manually change the pivot-dataset to
> change report of one month to another.
>
> In some other matters I make use of the formula expression: =CELLE
> ("filname";A1);6) to change sheet-references in formulas, but i think
> this is not a possible option when using menudriven prosedure.
>
> Yes I know I can make one big multi-month dataset, but there are some
> options regarding conditional formats (among other issues) in the
> dataset to allow for.
>
> Is there any option to change the pivot-datasheet-reference by using
> formulas? - or by using macros?
>
> Expectant regards
> Snoopy

Hi,

Record a macro while you change the pivot table data range manually.
Once you have amended the pivot table, stop recording and view the
macro.
You should see something like this...

ActiveSheet.PivotTables("PivotTable1").ChangePivotCache
ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!R16C6:R18C12")

thats how to change the data range of the table.

To incorporate that into your macro try this


Sub ChangeRange()

dim DataRange as string
DataRange=Worksheets("The Name of the sheet with the pivot table
on").Range("d1")
ActiveSheet.PivotTables("PivotTable1").ChangePivotCache
ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:=
DataRange)
End Sub


then you just enter the range (including sheet name) of the data range
in d1 and run the macro.

You could expand this further using data validation lists or a listbox
that would negate the need to manually enter the address.

HTH

 >> Stay informed about: Changing pivot datasource by formulas? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
How to Past cells with formulas not using "$" without chan.. - Hello, I would like to copy / past a large amount of cells in which "$" has not been used in formules. Problem : referenced are changed (because "$" is not there). Example in A1 : "=B1+C1" if I copy A1 to A50 : the con...

Excel Pivot Table - Saving issue - Hi, I have a file which contains several pivot tables, when I save the file and reopen it for some reason it opens with all but one of the sheets as a normal table as opposed to a pivot. Has anyone experienced this before/ has a solution to my problem...

calculate percent of a col in pivot report - Hi, I have a pivot report based on a query against a database. The query has 3 columns Gender, CntMale, CntFemale In the pivot report, I need to show the percent of Male, for which I believe I need to have the column display the value in the CntMale....

Formulas Instead of Advanced Filter - Hi there, I have Excel 2003 and want to have formulas that do the same work as Advanced Filtering. I currently have a system that looks at data in one column (X) and, with a mixture of If, Index and Match formulas, determines unique data and places...

Format changing - I have some issues with an Excel file that I will try to explain. The file contains worksheets; 12 monthly progress reports, 1 data sheet, 1 information sheet, 12 comment sheets (to show progress against objectives set in the report). It is stored in....
   Windows Help (Home) -> Microsoft Excel All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]