pivottable: how to change source

  • Thread starter Christoph Strobelt [Bt]
  • Start date
C

Christoph Strobelt [Bt]

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").PivotTableWizard
SourceType:=xlDatabase, _ 'creation of pivot table
SourceData:=name,
tabledestination:=Application.ThisWorkbook.Worksheets("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").PivotTable("Pivot1").sourcedata
= name = "[" & fso.GetFileName(datei) & "]" & blatt & "!R4C2:R200C5"

but it didn't work.

bye
chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top