Two more things to throw into the mix...
Off the top of my head, you can create a view and then select all the tasks
in the view (a filtered view for instance). Then in Jack or John4's code,
you could replace the for each with this:
Dim t As Task
For Each t In Application.ActiveSelection.Tasks
One other thing to think of, if the file is a master project with external
predecessors or successors, then there is one more nest on the "IF" statement
Dim t as task
if not t.ExternalTask=true then ...
or
if t.externaltask = false then
--
If this post was helpful, please consider rating it.
Jim Aksel, MVP
Check out my blog for more information:
http://www.msprojectblog.com