Excel VBA Training Courses Take You Beyond The Macro Recorder
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 excellent for really simple operations such as producing a simple report. However, there are definite limitations to this approach. Firstly, because Excel plays back the steps just as they were originally performed by the user, recorded macros are notoriously slow to play back.
Secondly, recorded macros will only run correctly under the conditions in which they were first recorded. For example, if a certain worksheet needs to be active at a given point and it is not active when the macro is run, there will be an error and the macro will stop running.
This means, effectively, that recorded macros can only really be utilised by the person who records them. They cannot be given out to one’s work colleagues.
One of the first things we do on the Excel VBA training courses that we run at our London training centre is to wean users off the recorder. We give them a good grasp of the Excel object model, a way of programmatically representing each of the elements within the Excel environment such as workbooks, worksheets and cells.
Admittedly, Excel VBA can be difficult to grasp for those users who have done little or no programming. This is one reason why we prefer to run a five day intensive Excel VBA training course aimed at people new to VBA. We find that this approach gives everyone a chance to gain confidence and familiarity with this o environment.
Once we have put the recorder on a back-burner, we teach delegates the syntax and structure of VBA. We show them how to use variables to store both data and references to Excel objects (such as workbooks), how to create logical and iterative coding structures and how to allow the person running your macro to make choices.
Despite its initial complexity, attending an Excel VBA training course is a good investment. It can greatly enhance the productivity of an Excel user. Monthly operations and reports which used to take hours can suddenly be streamlined and accomplished with astounding rapidity.
Getting trained on Excel VBA is the only real way of losing one’s initial reliance on the macro recorder. However, the recorder should not be disregarded altogether. For example, if you find yourself working with an Excel object or procedure you find difficult to code, recording a few steps then examining code Excel generates is an excellent way to learn new VBA syntax.
The writer of this article is a developer and trainer with On-SiteTrainingCourses.Com, an independent computer training company offering Microsoft Excel training courses at their central London training centre.

Leave a Reply