Looping Through NonContiguous Selections

J

Jim Aksel

Project allows us to select up to 10 groups of non-adjacent tasks. I would
like to be able to loop through them programatically---

dim tsk as task
For each tsk in [The Block of non-Contiguos Selections]
'My wonderful code goes here
tsk.Text1="Wonderful Day"
Next tsk

Does anyone have a sample that would be useful?
 
J

Jim Aksel

Thanks. I need to look harder in the Object Browser next time around.
Works fine.
Jim
The software is not allowed to win.

Rod Gill said:
Hi,

Try:

Sub test()
Dim Tsk As Task
For Each Tsk In Application.ActiveSelection.Tasks
Debug.Print Tsk.Name
Next Tsk
End Sub


--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx


----------------------------------------------------------------------------------------------------


Jim Aksel said:
Project allows us to select up to 10 groups of non-adjacent tasks. I
would
like to be able to loop through them programatically---

dim tsk as task
For each tsk in [The Block of non-Contiguos Selections]
'My wonderful code goes here
tsk.Text1="Wonderful Day"
Next tsk

Does anyone have a sample that would be useful?
 

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