Microsoft Office Tutorials and References
In Depth Information
Editing macros
Editing macros
Once you’ve recorded a macro, it might work perfectly fine as you recorded it or it might
benefit from some adjustments to its code. By editing the macro’s code, you can give the
macro functionality that you cannot capture when recording the macro, such as dismissing
an alert. A macro’s code resides in a VBA module, and you work with the code in the Visual
Basic for Applications environment, commonly called the VBA Editor .
TIP The VBA language and VBA Editor are standard in many Microsoft Office applications,
including Project. Although the specific details of each program differ, the general way in
which you use VBA in each is the same. VBA automation is a powerful tool you can master,
and that knowledge can be used in many Microsoft programs.
The scenario: At Lucerne Publishing, you’ve recorded a macro to capture a repetitive task.
As handy as the Capture_GIF_Image macro is to use, it can be improved. Remember that
when you ran it in the previous exercise, you had to confirm that Project should overwrite
the existing GIF image. Because the intent of the macro is to capture the most current
information, you always want to overwrite the older information. You can change the macro
code directly to accomplish this
19
In this exercise, you work in the VBA Editor to fine-tune and enhance the macro you
recorded in the previous exercise and then run it.
1
On the View tab, in the Macros group, click Macros .
2
Under Macro name , click Customizing A.mpp!Capture_GIF_Image , and then click
Edit .
Project loads the module that contains the macro in the VBA Editor.
This VBA code was generated when Project recorded your macro.
Search JabSto ::




Custom Search