Solved

How do I ensure my Excel VBA application doesn't display each sheet as it processes them ?

Posted on 2014-11-12
3
79 Views
Last Modified: 2014-11-12
Hi All,

My Excel application reads rows from one workbook and copies them to another. In fact, it processes each sheet in turn and depending on certain conditions selectively copies/pastes the rows to corresponding sheets.

The procedure opens an input workbook and an output workbook and amongst all this activity, the application switches from one sheet to another, opening a file and displaying the sheet that is currently active.

How do I stop this ? I want the procedure to run from the Menu sheet (click of a button) and all processing to be done in the background with the Menu sheet continually displayed until the end of the procedure.

I tried inserting Activate statements throughout the procedure but it got into a mess.

Is there a standard command which I can employ for this functionality.

Thanks
Toco
0
Comment
Question by:Tocogroup
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
gowflow earned 500 total points
ID: 40437420
Put this in the start of the procedure:

'---> Disable Events
With Application
    .EnableEvents = False
    .ScreenUpdating = False
    .DisplayAlerts = False
End With

Open in new window



and just before the end of the sub put this
'---> Enable Events
With Application
    .EnableEvents = True
    .ScreenUpdating = True
    .DisplayAlerts = True
End With

Open in new window


This will ensure no fliquering and that you macro will execute the procedure and will not go to other events before it finishes

gowflow
0
 

Author Closing Comment

by:Tocogroup
ID: 40437554
Ah yes now I remember ! Thanks for that. Works perfectly
0
 
LVL 29

Expert Comment

by:gowflow
ID: 40437563
Great !
gowflow
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Turn date into age 17 33
Records from Access to Excel to specific cells 5 26
Conditional formatting excel 5 17
HOW I CAN MANUALLY Format AN COLUMN ! 2 17
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question