hello thanks to your question I was able to solve the problem, you really were very close to the solution, it was just putting $ objPHPExcel-> createSheet (); inside the loop
I leave part of my code as an example:
for ($ j = 0; $ j <5; $ j ++) {
if ($ j <> 0) {
$ objPHPExcel-> createSheet ();
}...
}