Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Thu, 3 Jul 2008 00:16:10 -0700,    group: microsoft.public.project.developer        back       


VBA Procedure to customize Material Cost Filed in MS Project 2003   
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
date: Thu, 3 Jul 2008 00:16:10 -0700   author:   Jayalakshmi

Re: VBA Procedure to customize Material Cost Filed in MS Project 2003   
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



"Jayalakshmi"  wrote in message 
news:42A15D39-BE62-4E18-B060-A72B964B0E61@microsoft.com...
> 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
>
>
date: Thu, 3 Jul 2008 22:26:22 +1200   author:   Rod Gill rodATproject-systemsDOTcoDOTnz

Re: VBA Procedure to customize Material Cost Filed in MS Project 2   
Hi Gill,

Thanks a Lot. Its working fine.....

Regards,
Jaya

"Rod Gill" wrote:

> 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
> 
> 
> 
> "Jayalakshmi"  wrote in message 
> news:42A15D39-BE62-4E18-B060-A72B964B0E61@microsoft.com...
> > 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
> >
> > 
> 
>
date: Fri, 4 Jul 2008 02:37:00 -0700   author:   Jayalakshmi

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us