Archive of Mr Excel Message Board


Back to Pivot Tables in Excel archive index
Back to archive home

Making pivot tables update automatically.

Posted by Paul on June 03, 2001 6:17 AM
I have just starting to use pivot tables, I put one in one of by workbooks the sheet name is "Table", and as you know it does not update itself, is there some code that would make the tables update when I select the worksheet? If so where would it go? I don't know much about VBA. Thanks for your help.

Re: Making pivot tables update automatically.

Posted by Dax on June 03, 2001 12:39 PM

Hi,
If you right click the pivot table worksheet tab and click view code you'll be presented with a worksheet code module. Code like this will update your pivot table every time you select it: -

Private Sub Worksheet_Activate()
ActiveSheet.PivotTables(1).PivotCache.Refresh
End Sub

HTH,
Dax.


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.