Skip to Main Content
Excel Hacks, 2nd Edition
book

Excel Hacks, 2nd Edition

by David Hawley, Raina Hawley
June 2007
Beginner content levelBeginner
410 pages
10h 2m
English
O'Reilly Media, Inc.
Content preview from Excel Hacks, 2nd Edition

Chapter 7. Macro Hacks

Hacks 106–134

Macros make it wonderfully easy to automate repetitive tasks in Excel, but the way they’re created and the facilities for using them are sometimes problematic. Fortunately, Excel is flexible enough that you can fix those problems and create new features with a minimum of effort.

Speed Up Code While Halting Screen Flicker

Speed Up Code While Halting Screen Flicker

When you record macros from within Excel, the code it generates often produces screen flicker, which not only slows down your macro, but also makes the macro’s activity look very disorganized. Fortunately, you can eliminate screen flicker while at the same time speeding up your code.

One drawback with recorded macros in Excel is that the code produced is often very inefficient. This can mean macros that should take a matter of seconds to complete often take a lot longer and look very unsightly. Also, when you write macros using the macro recorder, all keystrokes are recorded, whether they are meant to be or not. This means that if you make an error and then correct it, the keystrokes required to complete those actions also will be recorded in your macro code.

If you have played around a bit with macros or dabbled in VBA code, you might have heard of the Application.ScreenUpdating property. By setting ScreenUpdating to False at the start of a macro, you will not only stop the constant screen flicker associated with a recorded macro, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel Hacks

Excel Hacks

David Hawley, Raina Hawley
Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander

Publisher Resources

ISBN: 9780596528348Errata PageSupplemental Content