Resource assignments

P

Peter

Does anyone know how to write VBA macro that copies one
resource assignment from one task to another task? The
other task has not the same duration so I´d like to copy
start and finish of the assignment.

Thanks in advance,
Peter
 
J

John

Peter,
This quick answer is "yes" but is your real intent to transfer that
resource assignment or just copy it. Maybe I'm reading too much into
this but it seems that if the assignment is simply copied with the
identical resource start and finish, that resource will be working on
two diffenent tasks simultaneously. That scenario is possible, but it
does raise a question.

John
 
P

Peter

After it is copied I will delete it from the first task
so transfer is correct.

Regards,
Peter
 
P

Peter

I would like to transfer or copy one assignment from one
task to another. The task which will have the new
assignment has not the same start and finish as the first
task. For instance the first task to copy from has
start=Wed 03-12-03 08:00 and finish=Fri 03-12-05 17:00.
The task to copy to have start=Wed 03-12-03 08:00 and
finish=Tue 03-12-23 17:00.
So I will transfer/copy the assignment so the assignment
on the new task is on the first 3 days.
I think I have to know start and finish of assignment. I
can get those values but I have not succeded in transfer.
For the moment I just add the assignment which will
result in Unit=1 through the whole length/duration.

Any help is appreciated,
Peter
 
J

John

Peter,
If I understand your posts correctly, you don't really need to copy or
transfer the assignment at all. Simply delete the assignment from the
original task and then assign the resource to the other task with the
desired start, finish and utilization.

Assume the original task is 5 (assignment to be removed) and the other
task is 3 (assignment to be added). Further assume the resource involved
is resourceID #1. [Note: for any given task the resource assignment
index is determined by the resource ID as shown on the Task Form (lower
split screen). The lowest resource ID is the first assignment index for
that task and so forth.] Also, assume you want the resource to be
assigned at a utilization of 50% with a start of 03/12/03 8:00:00 and a
finish of 03/12/23 17:00:00. With these assumptions the code to make the
assignment "switch" might look something like this:

Set AP = ActiveProject
AP.Tasks(5).Assignments(1).Delete
AP.Tasks(3).Assignments.Add ResourceID:=1
AP.Tasks(3).Assignments(1).Units = 0.5
AP.Tasks(3).Assignments(1).Start = "03/12/03 8:00:00"
AP.Tasks(3).Assignments(1).Finish = "03/12/23 17:00:00"

Hope this helps.
John
 

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