View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Macro to update all queries

Josh,

As an example, the code below will refresh all queries in a sheet named
"Sheet2".

Sub Test
Dim qry As QueryTable
For Each qry In Sheets("Sheet2").QueryTables
qry.Refresh BackgroundQuery:=True
Next qry
End Sub

--
Hope that helps.

Vergel Adriano


"Josh Johansen" wrote:

I need to write a macro that will refresh or update about 10 queries that are
on another sheet. Automatically updating it when the file is opened is not
what they want to have happen, can someone help me figure this out, I really
am not too sure, thanks.