View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.charting
Andy Pope Andy Pope is offline
external usenet poster
 
Posts: 2,489
Default Refresh all but 1st sheet

Hi,

Although the loop index goes from to to the number of sheets the refresh is
made on the activesheets selection, which never changes.
Disabling DisplayAlerts should suppress the dialogs.

Try something like this.

Sub Refreshall ()
application.displayalerts=false
For i = 2 To workSheets.Count
worksheets(i).QueryTable.Refresh BackgroundQuery:=False
Next i
application.displayalerts=true
End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"pgarcia" wrote in message
...
Should't this work? Also, it ask to inmport text, how to say "yes"
evertime?
Text name will be different ever time.

Sub Refreshall ()
For i = 2 To Sheets.Count
With Active.Sheet
Selection.QueryTable.Refresh BackgroundQuery:=False
Next i
End Sub

Thanks