• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 27. Introduction to Visual Basic... > Creating a Filtering Macro

Creating a Filtering Macro

As an example to help you explore the VBE, a macro to filter tasks for the next two weeks only is a good exercise. Open a project file to record the following macro, or open "Chap27/Filter.mpp" from the CD. Perform the following steps to create the macro:

1.
Choose Tools, Macro, Record Macro.

2.
Enter a macro name of FilterNextTwoWeeks.

3.
Select to store the macro in This Project.

4.
You can edit the description if you wish and assign a shortcut key.

5.
Choose OK.

6.
Click Project, Filtered For and then the Date Range filter or select Date Range from the drop-down list of filters on the Formatting toolbar.

7.
Enter today's date and choose OK.

8.
Enter a date for two weeks time and choose OK.

9.
Click Tools, Macro, Stop Recorder to end the recording.

10.
Choose Tools, Macro, Visual Basic Editor or press Alt+F11 to display VBE.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint