VBA Procedure to customize Material Cost Filed in MS Project 2003

J

Jayalakshmi

Hello,

I want to customize one field in Gantt Chart that shows only Material Cost
of Tasks.

I got a reply form Microsoft that we need VBA procedure for that.

Anybody having some idea about VBA Procedure to customize Material Cost
Field in MSP 2003.

Help me!

Thanks & Regards,
Jaya
 
R

Rod Gill

Something like the following will work:

Sub MaterialsCost()
Dim Tsk As Task
Dim Res As Resource
Dim Assgn As Assignment
For Each Tsk In ActiveProject.Tasks
If Not Tsk Is Nothing Then
Tsk.Cost1 = 0
For Each Assgn In Tsk.Assignments
Set Res = ActiveProject.Resources(Assgn.ResourceID)
If Res.Type = pjResourceTypeMaterial Then
Tsk.Cost1 = Tsk.Cost1 + Assgn.Cost
End If
Next Assgn
End If
Next Tsk
End Sub

Insert teh column Cost1 to see the results.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top