Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
updating query in excel | Excel Worksheet Functions | |||
where do my SQL querries get stored in the MS query tool in excel? | Excel Programming | |||
Excel not automatically updating cells | Excel Discussion (Misc queries) | |||
Complex Query Not Able To Get Results in Excel | Excel Programming | |||
Excel formulas are not automatically updating | Excel Discussion (Misc queries) |