Sorry if this is an easy question, I just started using vba with MS Project.
I am trying to cycle through all the tasks in a MS Project file and delete a task if it meets a certain criteria. The problem happens after a task is deleted, it seems like the j task variable gets set to Nothing, which screws everything up. Any idea how I can do this?
For Each j In prj.Tasks
If j.Text10 = "1" Or j.Text10 = "2" Then ' If criteria is met
SelectRow Row:=j ' Select the row
EditDelete ' Delete the row
End If
Next j