Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Hide actions while macro executes


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Hide actions while macro executes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Hide actions while macro executes

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
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
2007: Macro recording not working for some actions MrT Excel Programming 1 November 28th 06 01:36 PM
Macro code to remove a macro after it executes Charles Excel Programming 4 March 22nd 06 12:11 PM
Subtotal Macro weird actions Bill[_22_] Excel Programming 4 August 5th 04 07:05 PM
excel executes only a part of a macro mgr[_2_] Excel Programming 2 January 15th 04 07:18 AM
How to hide all the actions while a macro is running milo[_2_] Excel Programming 3 October 4th 03 03:29 AM


All times are GMT +1. The time now is 06:33 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"