I'm not sure I understand exactly how you are interacting with the spreadsheet, but I am wondering if, rather than a change event, you are looking for something triggered by a calculate event, or maybe some other event.

It might a bit much, but I would suggest you explain exactly what "it works normally when there's no formula in the cell" and exactly what you mean by "when a cell contains a formula, it doesn't work as it should." Once we understand exactly how you are interacting with the sheet and what "works" and "does not work" mean, then maybe we can help by suggesting a better event structure or how to change the existing change event code.