2

I have a MS Project plan that orchestrates multiple hundred activities over a couple of hours (the tasks also have dependencies) and would like to drive the execution based on the plan.

During the orchestration of the plan, I could be faced with a situation in which someone would report that task 123 has been completed. Afterwards, another colleague might inform me that task 234 has been completed. Based on the completion of the two tasks, task 345 could now start.

Without manually checking the dependency column, how do I know that task 345 can start? Put differently: How do I create a list of all tasks that could start (such as task 345) because their prerequisites are fulfilled but that are not yet started?

1

There is a way to do this by using a flag, a macro, and a view. I put the below together with limited testing, but it worked fine in my sample project.

First, create a custom flag in MS Project, I've called mine "PredComplete" in Flag2. Custom Flag

Then we will write some VB code that will look at all tasks in the project. If the predecessors have been completed, then we will set Flag2 to "Yes". This will identify tasks where ALL their predecessors are done. NOTE: this doesn't care about the predecessor relationship, so if you use finish to finish a lot, this will not have the expected outcome.

Sub activetasks() Dim ProjTask As Task Dim AllTasks As Tasks Dim Pred As Task

Set AllTasks = ActiveProject.Tasks()

For Each ProjTask In AllTasks Set Pred = Nothing For Each Pred In ProjTask.PredecessorTasks If Pred.PercentComplete <> "100" Then ProjTask.Flag2 = "No" Exit For Else ProjTask.Flag2 = "Yes" End If Next Pred Next ProjTask End Sub

Once that is done, create a button in your Quick View that is tied to the vb method you just created, in this case, activetasks ().

Finally, we will create a view that filters all the tasks that have not started (completed = 0%, can also use Actual Start = "NA") where all predecessor tasks are completed (Flag2 = "Yes").

Custom View

After running the VB and applying your view, you should only see tasks where predecessors are complete, but have not been started yet. The way it's created, you will need to click the button every time you update your project. You can refine the VB to be a bit more efficient (ex. only include tasks that have not been completed), just in case your task list is thousands of lines long. That should start you off though!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.