ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pivottable: how to change source (https://www.excelbanter.com/excel-programming/337255-pivottable-how-change-source.html)

Christoph Strobelt [Bt]

pivottable: how to change source
 
hi. i want to know how to update an new data range of pivot table?


i create a pivot table with this range:

name = "[" & fso.GetFileName(datei) & "]" & blatt & "!R4C2:R400C5"
'range: r4c2:r400c5

Application.ThisWorkbook.Worksheets("Pivot").Pivot TableWizard
SourceType:=xlDatabase, _ 'creation of pivot table
SourceData:=name,
tabledestination:=Application.ThisWorkbook.Workshe ets("Pivot").Range("A9"),
_
tablename:="Pivot1"

now i want to change the range of "Pivot1" to r4c2:r200c5 , but i don't know
how i can do this.

i tried


Application.ThisWorkbook.Worksheets("Pivot").Pivot Table("Pivot1").sourcedata
= name = "[" & fso.GetFileName(datei) & "]" & blatt & "!R4C2:R200C5"

but it didn't work.

bye
chris




All times are GMT +1. The time now is 09:29 PM.

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