Summarizing Material Costs RRS feed

  • Question

  • Hello,

    I found the below MS Project VBA routine to list only the material cost of tasks. Unfortunately, (1) it does not add up the material cost of each task for the summary tasks, and (2) the Project Summary Task displays the total cost of the project (labor and material) and not just the total material cost of the project.

    Any thoughts?

    Is there a beginner VBA programming book for MS Project that is not terribly expensive.

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

    Tuesday, December 8, 2015 11:49 PM

All replies

  • Re:  MS Project

    There is MS forum devoted to MS Project at...
    You will probably find more people there familiar with it (I'm not).

    Jim Cone
    Portland, Oregon USA (Dropbox)
    (free & commercial excel add-ins & workbooks)

    • Edited by James Cone Tuesday, October 25, 2016 1:32 AM
    Wednesday, December 9, 2015 6:05 AM