View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default refreshing pivot tables with a macro

From VBA's help for .refreshall:

Remarks
Objects that have the BackgroundQuery property set to True are refreshed in the
background.

Maybe you want to change property to true.

Lou Sanderson wrote:

Windows XP, Excel 2002 SP 3

I have a simple macro that I run to refreshs all my external datasources in
my spreadsheet. Recently I've added some pivot tables as well. I would like
my macro to refresh the pivot tables if possible - currently it does not. Any
suggestions?

Here is my macro

sub macro1()

application.displayalerts = false
sheets("sheet1").select
range("a1").select
activeworkbook.refreshall
application.displayalerts = true
msgbox("refresh complete")
end sub

Thanks,
Lou Sanderson


--

Dave Peterson