Microsoft KB Archive/181116

From BetaArchive Wiki
Knowledge Base


Article ID: 181116

Article Last Modified on 1/22/2007



APPLIES TO

  • Microsoft Project 98 Standard Edition



This article was previously published under Q181116

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. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements. For additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:

163435 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.


Keywords: kbdtacode kbhowto KB181116