Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Automatically updating MS Query Tool results in excel

Hello,

I am using Excel as front-end to an access database. Various cells in the
spreadsheet are populated from an Access 97 database using the MS Query tool
to build a count SQL Query. I can right-click on every cell and then choose
"refresh" to update the result for each cell. However, since there are about
300 cells, to refresh them individually would be very time consuming.

My question is this: is there a way in vba to "refresh" multiple cells from
a single macro? I was thinking of a loop through each cell in a given range,
with a command to refresh each query in turn. Does anyone know what this
command would be?

Many thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Automatically updating MS Query Tool results in excel

Sub RefreshQueryTable()

Dim qt As QueryTable

For Each qt In ActiveSheet.QueryTables
qt.Refresh BackgroundQuery:=False
Next qt

End Sub



"Sardonic" wrote:

Hello,

I am using Excel as front-end to an access database. Various cells in the
spreadsheet are populated from an Access 97 database using the MS Query tool
to build a count SQL Query. I can right-click on every cell and then choose
"refresh" to update the result for each cell. However, since there are about
300 cells, to refresh them individually would be very time consuming.

My question is this: is there a way in vba to "refresh" multiple cells from
a single macro? I was thinking of a loop through each cell in a given range,
with a command to refresh each query in turn. Does anyone know what this
command would be?

Many 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
updating query in excel michelleFL Excel Worksheet Functions 0 April 7th 08 03:03 PM
where do my SQL querries get stored in the MS query tool in excel? Neall Excel Programming 1 October 27th 07 09:57 AM
Excel not automatically updating cells Erin Excel Discussion (Misc queries) 4 December 6th 06 04:35 PM
Complex Query Not Able To Get Results in Excel cb22 Excel Programming 2 January 19th 06 01:47 AM
Excel formulas are not automatically updating Sam M. via OfficeKB.com Excel Discussion (Misc queries) 3 January 9th 06 09:27 PM


All times are GMT +1. The time now is 10:28 PM.

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

About Us

"It's about Microsoft Excel"