View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
MIKE215 MIKE215 is offline
external usenet poster
 
Posts: 32
Default Change Pivot Table Range

Pat,

This is a scheme that works for me.
1) use a named range (PIVDATA) as the source of the pivot table
2) use VBA to set the range you would like to that name (PIVDATA)
3) use VBA to refresh all the pivot tables in the workbook

For step 1 : OPEN PIVOT TABLE WIZARD and enter the named range at step 2 of 3

For step 2 something like this. Assume B1 is a cell in the range you want
to use in the pivot table then:


"Pat Garard" wrote:

G'Day All,

I have a workbook that has a Worksheet containing raw data read from an
Access database using VBA/ADODB using criteria selected from a UserForm.

Several other Sheets contain summary reports of various kinds assembled
from the Raw Data using VBA.

I would like to construct two Pivot Tables/Charts based on the Raw Data.

How may I update the underlying range of these, when the raw data range
changes from time to time depending on the criteria?
--
Regards,
Pat Garard
Melbourne, Australia
_______________________