Recording a Visual Basic Macro in an External Module
Article ID: 108060
Article Last Modified on 10/10/2006
APPLIES TO
- Microsoft Excel 95a
- Microsoft Excel 95 Standard Edition
- Microsoft Excel 5.0c
- Microsoft Excel 5.0 Standard Edition
- Microsoft Excel 5.0a for Macintosh
- Microsoft Excel 5.0 for Macintosh
This article was previously published under Q108060
SUMMARY
In the versions of Microsoft Excel listed at the beginning of this article,
you can record a macro and save it in a different workbook than the
workbook you are performing the steps in. To do this, follow the steps
below to set the macro recorder to record in the other workbook:
- Select the Visual Basic module in the workbook where the macro should
begin recording.
- On the Tools menu, point to Record Macro, and click Mark Position for
Recording.
NOTE: At this point you can return to the workbook in which you plan to
perform the steps. To begin recording, point to Record Macro on the
Tools menu, and click Record at Mark.
NOTE: This method does not record the Sub() and End Sub statements
necessary to create a separate Sub procedure. This is by design. To create
a separate Sub procedure, add the Sub() and End Sub statements to the
recorded code manually.
NOTE: This method is not available in Microsoft Excel 97 for Windows or
Microsoft Excel 98 Macintosh Edition. For more information, please see the
following article in the Microsoft Knowledge Base:
157958 XL97: No "Record at Mark" Feature in Microsoft Excel
Additional query words: 5.00a 5.00c 7.00a XL XL5 XL7
Keywords: kbhowto kbprogramming KB108060