ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to change relative chart/pivotTabe ? (https://www.excelbanter.com/excel-programming/274487-re-how-change-relative-chart-pivottabe.html)

BrianB

How to change relative chart/pivotTabe ?
 
No need to keep remaking the pivot table if you use a "dynamic" range
that changes according to the length of data. Assuming that your data
is in a simple table with headings in row 1 and no blank cells in
column A ..........

1. In the Insert/Name/Define dialog box - Refers To :
type something like :-
= OFFSET(Sheet1!$A$1,0,0,COUNTA(Mysheet!$A:$A),10)
where the last number (10) is the number of columns in your table.

2. Give the range a name eg. Database

3. In the pivot table wizard use the name (Database) in the Range box.

Now all you have to do is change the data in Sheet1 and refresh the
pivot table.
If you want VBE code, record a macro as you do the job.

Regards
BrianB
==================================================





max chen wrote in message . ..
Hi

I'm a new bird of excel,plz help.

Step
1. import data from sql server to sheet 1.
2. create PivotTable/chart from the 10 row of data
3. change the condition of sheet1 and import 20 row of data

How can i make the PivotTable/chart change itself automatically, by
vba,macro ?

It important to my job, plz give me any advise.

TIA.

Max.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com