PRJ98: How to Filter to Show Tasks That Are Behind Schedule

ID: Q181116

The information in this article applies to:

SUMMARY

This article describes how to create a filter that displays tasks that are behind schedule for a specific date. It also describes how to apply a filter using a macro.

For example, if you have a 10-day task that should have started two days ago, the task should be 20 percent complete. If it is less than 20 percent complete, the filter will show it. If it is 20 percent complete or more, the filter will not show it.

MORE INFORMATION

When applied, the following filter shows only tasks that are behind schedule compared to the date that you enter. To create the filter, follow these steps:

1. On the Project Menu, point to Filtered For, and then click More

   Filters.

2. In the More Filters dialog box, click New.
   Microsoft Project names the filter Filter 1 by default.

3. Enter the following values in the columns of the Filter Definition
   dialog box:

      And/Or   Field Name   Test            Value(s)
      ---------------------------------------------------

               %Complete    Does not equal  100%
      And      Start        Is less than    "Enter Date"?
      And      Stop         Is less than    "Enter Date"?
      Or
               Start        Is less than    "Enter Date"?
      And      Stop         Equals          NA

4. Click OK.

5. Click Apply to use the filter or click Close to continue with the

   following steps.

Apply the Filter Using a Macro

You can also create a macro to apply the filter. By using the macro you only have to enter the date once, instead of three times.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft Support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/supportnet/refguide/default.asp

For additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q163435
   TITLE     : VBA: Programming Resources for Visual Basic for Applications

NOTE: A line that is preceded by an apostrophe (') introduces a comment in the code. Comments are provided to explain what the code is doing at a particular point in the procedure. Note also that an underscore character (_) indicates that code continues from one line to the next . You can type lines that contain this character as one logical line or you can divide the lines of code and include the line continuation character.

To create the macro that applies the filter, follow these steps:

1. On the Tools menu, point to Macro, and then click Macros.

2. In the Macro Name box, type RunFilter, and then click Create

   to open Visual Basic Editor.

3. Create a macro by typing the following subroutine:

      Sub RunFilter()
         Dim myvalue As Date
         Dim message
         message = "Enter the date and time you wish to measure against"
         myvalue = InputBox(message)
         FilterApply Name:="Filter 1", value1:=myvalue
         'Filter 1 is the name of the filter created for this process
      End Sub

4. On the File menu, click "Close and Return to Microsoft Project."

5. On the Tools menu, point to Macro, and then click Macros.

6. In the list of macros, click to select RunFilter.

7. Click Run.

8. Enter the date when prompted and click OK.

Additional query words:

Keywords          : kbdta kbdtacode PROJVBA projwin 
Version           : WINDOWS:98
Platform          : WINDOWS
Issue type        : kbhowto

Last Reviewed: May 18, 1999