Is it possible to change a predecessor automaticly (either through a formula or through automation)?

Dear all,

My question is, if it's possible to change a predecessor # NOT by hand but through automatic?

"Automatic" means, e.g. change the predecessor figure maybe through a formula or maybe through "Automation"?

Any idea or suggestion is greatly appreciated!

Thanks already in advance!

Best regards

Hans P. ... from Germany

P.S.: Here still a screenshot why I ask this question. The column field names are in German, but I guess you'll sense it easily what I try to intend.

The purpose of this is that I offset the checkbox at in the column "Notwendig" (EN: necessary) to switch then the precessessor to the previous task.

If I am not able to switch the predecessor by automation or formula then my project plan would be completely wrong, ... and this is actually the very essence of having a project plan.