Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying custom resoure fields in Gantt chart

Status
Not open for further replies.

theboyfold

Technical User
Jan 31, 2007
1
GB
I have a custom field that is assigned to Resources, which I would also like to appear in a Gantt chart. It's a text field, is there a way to this?

The field is assigned to resource

TIA
 
You'll need a VBA macro to do this and you'll have to run the macro whenever you update the resource info field.

You also have an issue to consider: what happens when you have two resources assigned to the same task? Do you want the Resource field for the first resource to appear? or the second? or both?

Here's a skeleton start that copies resource.Text1 info to task.Text2

Code:
Sub pdqbach()
Dim res As Resource
Dim asgn As Assignment
Dim tmpID As Long
For Each res In ActiveProject.Resources
    For Each asgn In res.Assignments
        tmpID = asgn.TaskID
        ActiveProject.Tasks(tmpID).Text2 = res.Text1
    Next
Next
End Sub

That code will update the Task fields with information from the Resource fields. If you want the info to appear in the left hand side of the Gantt display then just insert the necessary column (in this case, click on View | Gantt and then insert the Text2 column).

If you want the info to appear on the Gantt chart on the right hand side of the display then you'll have to click on Format | Bar styles ... and then make the appropriate display changes there.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top