Add Predecessor task name to predecessors?

K

KingKikapu

I'm having a bonehead day. Does anybody know how to modify a custom
field (presumably text) to display the Predecessors, but replace the ID
with the actual predecessor task name so that I can quickly see what it
is instead of constantly having to check what ID corresponds to what
task.

Thanks a bunch.
 
J

Jan De Messemaeker

Hoi,

This can only be done through VBA

Sub PredNames

for each job in activeproject.tasks
if not job is nothing then
job.text1=""
if job.predecessortasks.count>0 then
Ctr=job.predececessortasks.count
do while ctr>0
job.text1=job.text1 & job.predecessortasks(ctr).name
ctr=ctr-1
if ctr>0 then
job.text1=job.text1 & ";"
end if
loop
end if 'count
end if ' nothing
next job
end sub

Attention! if the total length of the text you try to put in text1 exceeds
255 in length the procedure will abend.

HTH







--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top