I have tried to insert the AutoCollapse command defined in this nice answer
inside a Button
Button["Input Délétion OK", AutoCollapse := (If[$FrontEnd =!= $Failed, SelectionMove[EvaluationNotebook, All, GeneratedCell]; FrontEndTokenExecute["SelectionCloseUnselectedCells"]])] AutoCollapse
But AutoCollapse stay blue and unevaluated or is evaluated and then unevaluated --- MA 10.1. Any idea ?