How to find current row

M

MikeMcSharry

Hi - I put this on the other group .. and Mike Glenn suggested stick
it here ..
Is there way in project 2007 standard to easily apply 3 or 4
identical subtasks to a few hundred tasks?
I know I could type the subtasks once and then cut and paste them to
all the tasks I've already entered - is there a better way?

I've tried to produce a bit of a macro from the recorder, but I need
to tune it just a bit ..
Row 16 to 19 include the lines I want to add elsehwere..

Problem with this macro is it doesn't add them where my cursor is - it
adds them at row 16 (I can't find the bit of code that says - my
current row is x, and then between the editcopy and editpaste line I
could go back there.
Also - I'm sure this is possible - I want to indent the rows whne they
are pasted .. any suggestions would be welcome.

Mike

Sub add4linesallareas()
SelectRow Row:=16, RowRelative:=False
SelectRow Row:=16, RowRelative:=False, Height:=1, Extend:=True
SelectRow Row:=16, RowRelative:=False, Height:=2, Extend:=True
SelectRow Row:=16, RowRelative:=False, Height:=3, Extend:=True
EditCopy
EditPaste
End Sub
 
J

John

MikeMcSharry said:
Hi - I put this on the other group .. and Mike Glenn suggested stick
it here ..
Is there way in project 2007 standard to easily apply 3 or 4
identical subtasks to a few hundred tasks?
I know I could type the subtasks once and then cut and paste them to
all the tasks I've already entered - is there a better way?

I've tried to produce a bit of a macro from the recorder, but I need
to tune it just a bit ..
Row 16 to 19 include the lines I want to add elsehwere..

Problem with this macro is it doesn't add them where my cursor is - it
adds them at row 16 (I can't find the bit of code that says - my
current row is x, and then between the editcopy and editpaste line I
could go back there.
Also - I'm sure this is possible - I want to indent the rows whne they
are pasted .. any suggestions would be welcome.

Mike

Sub add4linesallareas()
SelectRow Row:=16, RowRelative:=False
SelectRow Row:=16, RowRelative:=False, Height:=1, Extend:=True
SelectRow Row:=16, RowRelative:=False, Height:=2, Extend:=True
SelectRow Row:=16, RowRelative:=False, Height:=3, Extend:=True
EditCopy
EditPaste
End Sub

MikeMcSharry,
I saw your post on the main newsgroup and added my two cents in addition
to Mike's advice. You might want to read what I wrote.

With regard to developing a macro, the first thing you need to do is to
identify which "tasks" you want to add to. Perhaps the best way to do
that is with a spare flag field (e.g. Flag1). Add that field as a column
in your view and then put a "yes" in that field for each task you want
to add the subtasks to. And by the way, when you say "task" do you
really mean a summary line?

Once you have identified the tasks that will have subtasks added, then a
filter can be applied to isolate those tasks. This will make it easier
for a code loop to start adding the new subtasks. All of this can be
done using background processing where no task selection is necessary.

If you give me a little more detail on exactly what you need, I can
write the code for you, but depending on internet response time, it
might take a several hours - I'm not on-line continuously.

John
Project MVP
 
M

MikeMcSharry

Hi John
Sorry about using the wrong terms there ..
The project I have set up will help an organiwsation plan the
activities to receive a particular accreditation. Each stage of the
accreditation requires them to show that they have developed the
qualities needed.
So each step requires them to work through the following stages ..
Collect relevant current information
Prepare draft report
Refine draft information
Agree Final Information
So - although these tasks (in the wider defn. of tasks) need to be
repeated they are independent for each task (in Project terms). (I
think what I really meant to say was 'same task descriptions!)
I know that by copying them we'll start life with the same durations
for these task 9descriptions!)

The code I've dragged from the macro recorder nearly works - I just
need to tell the macro to come back to the line I'm running from
before I paste. I've set them macro to ctrl-key - so it's possibly a
similar job (nearly said task there :)) to click down to relevant rows
and press the ctrl/key combo as it is to flag the fileds I want then
let it run.

Any help would be really appreciated (I'm sure it's really simple)..
Long time since I did 6502 assembler!!

Mike
 
M

MikeMcSharry

Hi John
You're right - when I've said tasks I mean the same task descriptions

The code needs to do what I've shown, but somehow - record the line
I'm on - copy those fxed lines - come back to the line I'm on - then
paste the lines in

DOes tha make sense?

Many thanks
Mike
 
J

John

MikeMcSharry said:
Hi John
Sorry about using the wrong terms there ..
The project I have set up will help an organiwsation plan the
activities to receive a particular accreditation. Each stage of the
accreditation requires them to show that they have developed the
qualities needed.
So each step requires them to work through the following stages ..
Collect relevant current information
Prepare draft report
Refine draft information
Agree Final Information
So - although these tasks (in the wider defn. of tasks) need to be
repeated they are independent for each task (in Project terms). (I
think what I really meant to say was 'same task descriptions!)
I know that by copying them we'll start life with the same durations
for these task 9descriptions!)

The code I've dragged from the macro recorder nearly works - I just
need to tell the macro to come back to the line I'm running from
before I paste. I've set them macro to ctrl-key - so it's possibly a
similar job (nearly said task there :)) to click down to relevant rows
and press the ctrl/key combo as it is to flag the fileds I want then
let it run.

Any help would be really appreciated (I'm sure it's really simple)..
Long time since I did 6502 assembler!!

Mike

Mike,
I was thinking about a more automated approach but if all you want to do
is to copy a set of tasks and go to the line(s) where you want them
inserted, the following trivial macro will do that, but I don't see that
it is any easier than simply doing a manual paste.

Sub Copy_Tsks()
EditPaste
End Sub


John
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