Question : MS Project 2007, How to add a Column 'Percent'

Hi !

I have MS Project 2007

Let we have a Project with 5 Steps.

Each step costs 100 $, so the project total costs is 100*5 = 500 $

I need to have a Column Percent, where the cost in percent for the each step is presented

See the Screenshot  (View / Cost)

How to create such a column ?

Answer : MS Project 2007, How to add a Column 'Percent'

Hi,

if you don't use Projectserver there is no way to get the total of the project's cost into a formula. So you only can do a calculation in a macro like this one:

--- cut here
Sub CalculateCostPercentage()

    Dim oTask As Task
   
    For Each oTask In ActiveProject.Tasks
        If Not oTask Is Nothing Then
            oTask.Number1 = Format(oTask.Cost / ActiveProject.Tasks.UniqueID(0).Cost * 100, "0.0")
        End If
    Next
   
    'optional
    ActiveProject.Tasks.UniqueID(0).Number1 = 100
End Sub
--- cut here

Just open the VB Editor, copy the code into it and run it.

Good luck!

thausla
Random Solutions  
 
programming4us programming4us