ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Muting Macros (https://www.excelbanter.com/excel-discussion-misc-queries/25126-muting-macros.html)

Gary's Student

Muting Macros
 
I have several macros which, upon execution, flash updates to the screen with
blinding speed, displaying the results of the commands. How can I inhibit
this window chatter once the macros are de-bugged?
--
Gary's Student

Jan Karel Pieterse

Hi Gary's,

How can I inhibit
this window chatter once the macros are de-bugged?


Application.ScreenUpdating=False
'Your code
Application.ScreenUpdating=True

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com


JE McGimpsey

First,

Application.ScreenUpdating = False
'<Your code here
Application.ScreenUpdating = True

Second, if the reason your macros are flashing is that you're making
selections/activations, eliminating them will eliminate the flashes, as
well as speeding up your code. For instance, instead of

Sheets("Sheet1").Activate
Range("A1:J10").Select
Selection.Copy
Sheets("Sheet2").Activate
Range("AB45").Select
ActiveSheet.Paste

use

Sheets("Sheet1").Range("A1:J10").Copy Destination:= _
Sheets("Sheet2").Range("AB45")


Working with range objects directly instead of the selection object
makes your code smaller, faster, and IMO, easier to maintain.

In article ,
"Gary's Student" wrote:

I have several macros which, upon execution, flash updates to the screen with
blinding speed, displaying the results of the commands. How can I inhibit
this window chatter once the macros are de-bugged?


Gary's Student

Thank you
--
Gary's Student


"Jan Karel Pieterse" wrote:

Hi Gary's,

How can I inhibit
this window chatter once the macros are de-bugged?


Application.ScreenUpdating=False
'Your code
Application.ScreenUpdating=True

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com




All times are GMT +1. The time now is 06:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com