Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Macro to update all queries

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Macro to copy, paste and then update web queries Josh Johansen Excel Programming 0 July 23rd 07 06:16 PM
Running UPDATE and APPEND queries from Access in Excel Amery Excel Programming 1 February 9th 07 01:20 AM
macro to delete specific row with queries embedded Mervyn Excel Programming 0 November 9th 06 03:01 AM
Please Help...Multiple web queries and Macro help needed! Kinneth[_2_] Excel Programming 0 July 13th 06 02:59 AM
Executing multiple queries through a macro Sharon Excel Discussion (Misc queries) 0 April 1st 05 01:47 AM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"