Dispense With The Macro Recorder With Excel VBA Training
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.
Also, recorded macros will only run normally under the conditions in which they were originally recorded. Thus, for example, if a particular worksheet has to be active at a certain point and it is not active when the macro is played back, the user will get an error.
This means that recorded macros are only of use to the person who records them. They cannot be distributed to work colleagues.
One of the first things we do when we run an Excel VBA training course at our London training centre is to attempt to wean users off the recorder. We provide them with a good grasp of the Excel object model, a way of programmatically representing all of the elements that make up the Excel environment such as cells, workbook and worksheets.
True, there is a bit of a steep learning curve for those users who have done little or no programming. This is one reason why we run a five day intensive Excel VBA training course for new users. We find that it gives everyone a chance to gain confidence and familiarity with this challenging 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 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.