Pues asi
Código PHP:
<?PHP
// AGREGO UNA FUNCION PUES YA SON MAS DE 2 VECES QUE SE REPITE EL CODIGO
function insert($valores){
mysql_query("insert into listcon values ".$valores);
}
$f=1000; //para insertmultiple
while($param==0) //mientras el parametro siga en 0 (iniciado antes) que quiere decir que no ha encontrado un NULL entonces siga metiendo datos
{
$USUARIOS=$objPHPExcel->getActiveSheet()->getCell('A'.$i)->getCalculatedValue();
$GRUPO=$objPHPExcel->getActiveSheet()->getCell('B'.$i)->getCalculatedValue();
$valores.="('$USUARIOS','$GRUPO'),";
if($i==$f){
$valores=substr($valores,0,-1);
insert($valores) //INSERTAMOS
$f+=1000;
}
if($objPHPExcel->getActiveSheet()->getCell('A'.$i)->getCalculatedValue()==NULL)
//pregunto que si ha encontrado un valor null en una columna inicie un parametro en 1 que indicaria el fin del ciclo while
{
$param=1; //para detener el ciclo cuando haya encontrado un valor NULL
}
$i++;
$contador=$contador+1;
}
// verificas cuando sales del while que no quede ningun resto in cargar
if($i<$f && $i>($f-1000)){
$valores=substr($valores,0,-1);
insert($valores) //INSERTAMOS
}else{
if($i<1000){ // SI NO SUPERA LOS 1000 REGISTROS CARGA LOS QUE ALLA
$valores=substr($valores,0,-1);
insert($valores) //INSERTAMOS
}
}
//-----------------------------------------------------------------------/
?>