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