If you have MS Project 2010 or later, you can set the tasks inactive (right mouse button / inactivate task). This makes duration etc. not affecting other tasks any more even if still stated in the inactive tasks. Otherwise, a macro like this should help:
Dim tskX As Task
For Each tskX In ActiveProject.Tasks
If Not (tskX Is Nothing) Then 'Do not combine this line with any other line! You would get runtime errors when accessing empty tasks (space rows) in your schedule.
If Not tskX.ExternalTask Then 'You can't modify external linked tasks anyhow. You would get runtime errors if trying this.
If tskX.Text1 = "x" Then 'Instead of "Text1" you can access the field containing your criteria here
tskX.PercentWorkComplete = 0
tskX.Duration = 0
End If
End If
End If
Next tskX
Best regards, Kawi42