Inserting Subtasks

D

David M C

Is there a quick way to insert a set of subtasks under every task in the
programme? I have a list of 1500 addresses in excel, that all need the same
"mini" project performed on them.

Ideas?

Thanks

Dave
 
J

Jan De Messemaeker

Hi,

Maybe somebody else sees something more evident but I would use a VBA
procedure to do that. I could write some skeleton if you are a bit familiar
with VBA or macros.
HTH
 
D

David M C

I'm vaguely familiar with VBA in Access and Excel, and can programme in other
languages, but a quick outline would be helpful. There will be three or four
Subtasks to every currently existing task.

In project at the moment, I have the list of approx. 750 addresses. I'd like
to insert, as subtasks for every address:

Pre-Paint Repairs 0.5d
External Decs 2d
Snagging 0.5d

All three are linked in sequence.

Thanks

Dave
 
J

Jan De Messemaeker

OK, here wse go.
I suggest to do some (easy) preparatory work manually to make the procedure
lighter.
Create all the future summary tasks (locations) f.i. by copy/paste
Below the last one, create the subtasks you want to multiply, link them is
necessary. (don't forget to indent)
Select these subtasks (by selecting the IDs)

Now run this macro:

sub mult()
h1=activeselection.tasks.count
id2=activeselection.tasks(1).ID - 1
for id3=id2 to 2 step -1
selectrow row:=id3,rowrelative:=falce
editpaste
selectrow row:=id3,rowrelative:=false,height:=h1-1
outlineindent
next
end sub

good luck!
 
D

David M C

Here's what I did.

Copy/Pasted all the addresses from excel into project (We now have a long
list of addresses).

Under the last address, I put the 3 subtasks, their durations, and their
predecessors.
eg:

ID TaskName Duration Pred

751 Pre-Paint Repairs 0.5d
752 External Decs 2d 751
753 Snagging 0.5d 752

I then selected all three tasks (hold shift, click 751, click 753). Clicked
Indent. Then ran your macro.

I ended up with every task above those selected being a subtask of the task
above.
eg:

23 The Road
24 The Road
25 The Road

Any ideas where it/I went wrong?

Thanks

Dave
 
J

Jan De Messemaeker

Hi,

Are you sure you selected the whole task (by clicking the ID) and not just
some or even all the fields?
I did test this before sending!
HTH
 
D

David M C

Got it working. Missed the very last step. You have do a copy (of the last
three tasks) before you run the macro.

Thanks very much,

Dave
 
J

jempot

This code does not work for any subtasks that have further subtask
within them. I can't figure out what to change in the code. Can anyon
help
 
M

Mike Glen

Hi jempot,

What code? Try posting the code in the developer newsgroup. Please see FAQ
Item: 24. Project Newsgroups. FAQs, companion products and other useful
Project information can be seen at this web address:
http://project.mvps.org/faqs.htm

Mike Glen
Project MVP
 

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