Do[
        Plot[Sin[2 Pi f t], {t, 0, 1}], {f, 1, 
          5}];
SelectionMove[EvaluationNotebook[], After, 
        EvaluationCell];
SelectionMove[EvaluationNotebook[], Next, 
        CellGroup];
FrontEndTokenExecute["OpenCloseGroup"]