Here is a code I found but can not get it to work. I think it is because the cell that is being modified is the cell from another sheet that is linked to the sheet where I want the cells to be deleted.
function onEdit(e){ if(e.range.getA1Notation() == 'A1'&& e.range.getSheet().getName() == 'Sheet 1' ) e.source.getRange('B1').clear()}