Muting Macros

G

Gary's Student

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?
 
J

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.
 
Top