Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
data refresh all worksheets in a workbook using vba
I have set up a Database query and query will get data to populate all
worksheets in a workbook. At the moment I have to go to each worksheet and press refresh data button to update. Is there a VBA code whereby I could refresh all worksheets in the workbook. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
data refresh all worksheets in a workbook using vba
Sub RefreshQrys()
For Each wSht In ThisWorkbook.Worksheets For Each qt In wSht.QueryTables qt.Refresh Next For Each pt In wSht.PivotTables pt.RefreshTable Next Next End Sub Works best if none of the queries have the "BackgroundQuery" property set to true as it ensures that they are refreshed 1 at a time -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "Sarah W" <Sarah wrote in message ... I have set up a Database query and query will get data to populate all worksheets in a workbook. At the moment I have to go to each worksheet and press refresh data button to update. Is there a VBA code whereby I could refresh all worksheets in the workbook. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Refresh pivot table in workbook A when changing a cell in workbook | Excel Worksheet Functions | |||
REFRESH DATA in all Worksheets upon open of workbook | Excel Discussion (Misc queries) | |||
Create refresh button in worksheet to refresh Pivot Table Data | Excel Worksheet Functions | |||
XL 2007: Pivot Refresh slow when data resides in another workbook | Excel Discussion (Misc queries) | |||
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH | Excel Programming |