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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bar Labelling

Status
Not open for further replies.

Wilster31

Technical User
Jun 1, 2011
3
GB
Is it possible to label a bar with a predecessor task name rather than predecessor number?
 
Yes

Assuming that it's the Gantt view you wish to change:

View > Gantt
Format > Bar styles

In the popup:

In the top half, click on the row 'style' you wish to update
In the bottom half, click on the "Text" tab

You will see where to make your changes.

The changes you make are local to that view. So if you have several different views, you can customize each to your own specific requirements.
 
Oh, silly me. I didn't read the entire question.

You'll need to run some VBA to capture the name of the predecessor task.

Whenever you have changed the predecessors you'll need to rerun the code.

Option Explicit
Sub pdqbach()

Dim tsk As Task
Dim iPredLoop As Integer
Dim strPreds As String

For Each tsk In ActiveProject.Tasks
If tsk.PredecessorTasks.Count > 0 Then
strPreds = ""
For iPredLoop = 1 To tsk.PredecessorTasks.Count
strPreds = strPreds & tsk.PredecessorTasks(iPredLoop).Name
If iPredLoop <> tsk.PredecessorTasks.Count Then
strPreds = strPreds & ", "
End If
Next
tsk.Text1 = strPreds
End If
Next

Sorry for the hasty and erroneous reply earlier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top