Handling Predecessors with VBA

P

podge

Folks,
I have a project with 22 modules. Each module has 77 identical tasks,
work, duration etc. I thought I could copy the tasks and durations etc
for each module so I came up with the amatuer code below which copies
the first module and inserts where required. Not pretty but got to
start somewhere.
I didn't take the predecessor logic into account and find that if task
2 module 1 has task 1 as it's predecessor then so does task 2 module
2. Need a way of making the predecessor relative not absolute. Tried
playing but if rowrelative:= fasle then editpaste fails and suspect
answer not that easy anyway.
How do you handle predecessors?!
Many thanks for any help
Patrick


Sub copytasks()
' Copies a bunch of tasks (control module), pastes the tasks
'into a field inputted by the user and indents the tasks.

SelectTaskField Row:=3, Column:="Name", rowrelative:=True,
Height:=2
SelectTaskField Row:=3, Column:="Duration", rowrelative:=True,
Add:=True, Height:=2
SelectTaskField Row:=3, Column:="Work", rowrelative:=True,
Add:=True, Height:=2
SelectTaskField Row:=3, Column:="Constraint Type",
rowrelative:=True, Add:=True, Height:=2
SelectTaskField Row:=3, Column:="Predecessors", rowrelative:=True,
Add:=True, Height:=2
SelectTaskField Row:=3, Column:="Resource Names",
rowrelative:=True, Add:=True, Height:=2
EditCopy
EditGoTo ID:=InputBox("Enter a task number to paste into")
EditPaste

SelectTaskField Row:=(ActiveCell.Task.ID), Column:="name",
rowrelative:=True, Height:=2
OutlineIndent

End Sub
 

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