Excel VBA Courses Wean Users Off The Macro Recorder

by Andrew Whiteman

Most people’s first exposure to Excel VBA (Visual Basic for Applications) involves recording a macro. As the user performs a series of steps (for example opening a workbook going to a particular worksheet, copying some data, etc) Excel faithfully records each step by creating the necessary VBA code. Each time the user runs the macro, the steps are replayed exactly as they were recorded.

Recording macros is ideal for really simple tasks such as producing an extremely strait-forward report. However, there are distinct restrictions on this approach. Firstly, because Excel plays back the steps just as they were originally performed, recorded macros are often painfully slow.

Secondly, recorded macros will only run properly under the conditions in which they were originally recorded. For example, if a particular worksheet needs to be active at a certain point and it is not active when the macro is played back, an error will occur.

This means, effectively, that recorded macros can only really be used by the person who recorded them. They cannot be distributed to one’s work colleagues.

One of the first things we find we have to do on the Excel VBA training courses that we run at our London training centre is to steer users away from the macro recorder. We offer them a good grasp of the Excel object model, a way of programmatically encoding each of the elements within the Excel environment such as the application itself, workbooks, worksheets and cell ranges.

Naturally, there is a bit of a steep learning curve for any users who have done little or no programming. For this reason, we run a five day crash-course in Excel VBA for fledgling macro programmers. We have found that this provides everyone with a chance to gain some degree of confidence with the challenging VBA environment.

After weaning users off the macro recorder, we explain to them the syntax and structure of VBA. They learn how to use variables to store both data and references to Excel objects, how to code logical and iterative structures and how to allow the person running a macro to choose between different options.

Getting some training on Excel VBA is always worth the effort. It can take the productivity of an Excel user to a new level very rapidly. Monthly procedures and reports which used to take long hours can suddenly be accomplished with astounding ease and lightening speed.

Getting trained on Excel VBA is a great way to wean oneself off the macro recorder. However, the recorder will still always have its uses. For example, when you are working with an Excel object or a series of steps with some degree of programmatic complexity, recording a few steps then looking at the code generated is a great way to learn new syntax.

About the Author:

Last 5 posts by Andrew Whiteman

StumbleUpon It!

Related posts


Like this post? Publish It On Your Own Blog

International Handbook of Virtual Learning Environments (Springer International Handbooks of Education) (Hardcover) newly tagged "computers and technology"
International Handbook of Virtual Learning Environments (Springer International Handbooks of Education)
International Handbook of Virtual Learning Environments (Springer International Handbooks of Education) (Hardcover)
By Joel Weiss

 

Introduction to Computers and Technology: An Introducti
US $29.47
End Date: Saturday Dec-20-2008 16:59:14 PST
Buy It Now for only: US $29.47
Buy it now | Add to watch list

Diebold, John. MAN AND THE COMPUTER : Technology 1st
US $95.00
End Date: Sunday Dec-21-2008 16:33:20 PST
Buy It Now for only: US $95.00
Buy it now | Add to watch list

NEW Computer Technology and Social Studies - Percept...
US $89.00
End Date: Thursday Dec-25-2008 7:56:57 PST
Buy It Now for only: US $89.00
Buy it now | Add to watch list

NEW Learning Computers And Technology 9780133639773
US $76.63
End Date: Thursday Dec-25-2008 13:31:18 PST
Buy It Now for only: US $76.63
Buy it now | Add to watch list

NEW How Computer Technology Influences Art and Desig...
US $111.00
End Date: Thursday Dec-25-2008 14:01:15 PST
Buy It Now for only: US $111.00
Buy it now | Add to watch list

Leave a Reply