Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have an excel file with 8 worksheets. Each of these pulls data from a SQL Server database. I have created a Macro which refreshes these all individually & then returns to the first worksheet. It is possible to make this happen without seeing each worksheet get selected, refresh, etc, keep the focus on the first sheet and update a cell with the current action? i.e. "Refreshing Batch Update workseet..." & so on. And after its completed to display "Refresh completed at 1-dec-2006 08:15am" Copy of Macros below Help appreciated! Sub RefreshAll() ' ' RefreshAll Macro ' Macro recorded 30-11-2006 by Ben Watt ' ' Sheets("Summary").Select Range("A6").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Batch Update").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Datawarehouse ETL").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Disk Space").Select Range("A42").Select ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh Sheets("Scheduled Jobs").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Scheduled Jobs Perf").Select Range("A42").Select ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh Sheets("SQL DATA").Select Range("A42").Select ActiveSheet.PivotTables("PivotTable5").PivotCache. Refresh Sheets("SQL LOGS").Select Range("A42").Select ActiveSheet.PivotTables("PivotTable6").PivotCache. Refresh Sheets("Summary").Select Range("A6").Select End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ben,
Use Application.ScreenUpdating = False ''''''''''''''''''''''''''' ' your code here '''''''''''''''''''''''''' Application.ScreenUpdating = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Ben Rum" wrote in message . .. I have an excel file with 8 worksheets. Each of these pulls data from a SQL Server database. I have created a Macro which refreshes these all individually & then returns to the first worksheet. It is possible to make this happen without seeing each worksheet get selected, refresh, etc, keep the focus on the first sheet and update a cell with the current action? i.e. "Refreshing Batch Update workseet..." & so on. And after its completed to display "Refresh completed at 1-dec-2006 08:15am" Copy of Macros below Help appreciated! Sub RefreshAll() ' ' RefreshAll Macro ' Macro recorded 30-11-2006 by Ben Watt ' ' Sheets("Summary").Select Range("A6").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Batch Update").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Datawarehouse ETL").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Disk Space").Select Range("A42").Select ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh Sheets("Scheduled Jobs").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Scheduled Jobs Perf").Select Range("A42").Select ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh Sheets("SQL DATA").Select Range("A42").Select ActiveSheet.PivotTables("PivotTable5").PivotCache. Refresh Sheets("SQL LOGS").Select Range("A42").Select ActiveSheet.PivotTables("PivotTable6").PivotCache. Refresh Sheets("Summary").Select Range("A6").Select End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cool, will give that a go.
I've been on your website recently, excelllent stuff..! Thanks Ben Chip Pearson wrote: Ben, Use Application.ScreenUpdating = False ''''''''''''''''''''''''''' ' your code here '''''''''''''''''''''''''' Application.ScreenUpdating = True |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007: Macro recording not working for some actions | Excel Programming | |||
Macro code to remove a macro after it executes | Excel Programming | |||
Subtotal Macro weird actions | Excel Programming | |||
excel executes only a part of a macro | Excel Programming | |||
How to hide all the actions while a macro is running | Excel Programming |