Saviz said:
Hi,
Is there a way to display Pre/Succ name in a field?
(I am not after the pre/successor)
Eg have a task A's successor name displayed in say Text1.
Saviz,
Sure, but it will require some VBA code to do it and it could get a bit
messy if there are multiple predecessors or successors for each task.
In a simple form, the following code will put the predecessor task name
in spare task Text9. It also will skip tasks with multiple predecessors.
Handling multiple predecessors can be done but it gets more complex.
Sub pred_name()
For Each t In activeproject.Tasks
If Not t Is Nothing Then
If t.Predecessors <> "" And InStr(t.Predecessors, ",") = 0 Then
t.Text9 = activeproject.Tasks(CInt(t.Predecessors)).Name
End If
End If
Next t
End Sub
John
Project MVP