Muting Macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top