Screenupdating vba msdn
On the eve before Christmas, I'm writing this article on VBA code optimization for my blog readers as a gift. For example, a macro that required several seconds to complete in an earlier version of Excel may require several minutes to complete in a later version of Excel.
It contains both the knowledge and good practices which if followed and used effectively then it might put you in elite category of excellent VBA programmers. This problem may occur if the following conditions are true: * The VBA macro modifies the properties of many rows or columns.
Reduce the number of Lines: Avoid multiple statements especially when they can be clubbed into one line.When the VBA macro is executed, VBA processor fetched single line at a time.The tokens of the fetched line saved by virtual compiler are now interpreted and executed then next line is fetched and so on.When we combine multiple lines using colon into one line, we're reducing the number of fetch cycles the processor must go through.Our Suggestion: This change will bring minor difference in time due to faster processors today.
Search for screenupdating vba msdn:
Avoid 'Screen Flickering' or 'Screen Repainting': Use Application.