The Macro Recorder

Earlier in this chapter, I discuss the macro recorder, which is a tool that converts your Excel actions into VBA code. This section covers the macro recorder in more detail.

Note This is another reminder to make sure that Excel displays the Developer tab in the Ribbon. If you don't see this tab, refer to "Displaying Excel's Developer tab" earlier in this chapter.

The macro recorder is an extremely useful tool, but remember the following points:

■ The macro recorder is appropriate only for simple macros or for recording a small part of a more complex macro.

■ Not all the actions you make in Excel get recorded.

■ The macro recorder cannot generate code that performs looping (that is, repeating statements), assigns variables, executes statements conditionally, displays dialog boxes, and so on.

■ The macro recorder always creates Sub procedures. You cannot create a Function procedure by using the macro recorder.

■ The code that is generated depends on certain settings that you specify.

■ You'll often want to clean up the recorded code to remove extraneous commands.

0 0

Post a comment