Microsoft KB Archive/126389

{|
 * width="100%"|

Project: Macro to Display Work Progress in Gantt Chart

 * }

Q126389

-

The information in this article applies to:


 * Microsoft Project for Windows, version 4.0
 * Microsoft Project for the Macintosh, version 4.0

-

SUMMARY
Using Microsoft Project, you can use a macro to create a custom Gantt bar whose length is calculated as a percentage of a different task bar. This macro can be useful for displaying different types of progress information on a task that is not normally available in Gantt bar form.

For example, although Microsoft Project does not provide a standard Gantt bar that represents the percentage of work performed on a task, you can create such a bar by modifying the Gantt Chart and creating a custom macro.

MORE INFORMATION
The default Gantt Chart in Microsoft Project includes a Progress bar which visually represents the % Complete of a given task, which is based on the task's duration. However, there is no direct way to create a corresponding Work Progress bar to represent the % Work Complete of a given task. However, you can use a Visual Basic macro to create such a bar.

In order to create a custom bar in the Gantt chart, you must specify two date fields between which the bar should be drawn. For the Work Progress bar, these two fields will be Start and Start5. The Start5 field will be calculated by the macro in such a way that the length of this bar accurately represents the % Work Complete of the task.

Before you create the custom macro, add the new bar definition to your Gantt Chart by following these steps:

 While in the Gantt Chart view, from the Format menu, choose Bar Styles.  On the first blank row in the Bar Styles dialog, enter the following bar definition:   Name            Show For...Tasks   Row    From     To   -

Work Progress  Normal             1      Start    Start5 Select a style for the bar using the options on the Bar tab at the bottom of the Bar Styles dialog.  Choose OK to close this dialog box.

Microsoft provides examples of Visual Basic procedures 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 Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.

To create the custom macro, do the following:


 * 1) From the Tools menu, choose Macros.
 * 2) Choose New to bring up the New Macro dialog box.
 * 3) Enter CalcWorkProgress in the Macro Name field, then choose OK.
 * 4) In the Module Editor view, enter the code for the procedure that follows, exactly as shown:

Running the Macro
You should run the macro any time you want to update the Work Progress bars in your Gantt Chart.

To run this macro, do the following:


 * 1) From the Tools menu, choose Macros.
 * 2) From the list of macros, select CalcWorkProgress, and then choose Run.

Additional query words:

Keywords :

Issue type : kbinfo

Technology : kbHWMAC kbOSMAC kbProjectSearch kbProject400Mac kbProjectMacSearch kbProject400