View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier Roger Govier is offline
external usenet poster
 
Posts: 2,886
Default automatically update pivot tables when dynamic named range is expa

Hi Dave

You could add some simple event code to the sheet with your data table
something like

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Target.Count 1 Then GoTo endsub
If Target.Column < 4 Then GoTo endsub
Sheets("Sheet4").PivotTables("PivotTable1").PivotC ache.Refresh
endsub:
Application.EnableEvents = True
End Sub

Insert this in the code module of the sheet with your data.

Alter Target.Column < 4 to the column number where the last entry of
the new row with your bank transaction occurs.

Change "Sheet4" to the sheet name holding your Pivot Table, and
"PivotTable1" to the name of your PT as shown in Table Properties for
the PT.
--
Regards

Roger Govier


"Dave F" wrote in message
...
I have a dynamic named range that is a data table of bank transactions.
How
can I have my pivot tables automatically update when I add data to the
data
table? I would prefer not to have to click the refresh data icon on
the
pivot table toolbar if possible.

I'm not sure if it's relevant but here's the formula used for the
dynamic
named range: =OFFSET('Acct XXX'!$A$1,0,0,COUNTA('Acct XXX'!$A:$A),9)

Thanks,

Dave

--
Brevity is the soul of wit.