Bonjour,
Tu ajoutes cette fonction
Object.prototype.getLastDataRow = function(col){
var lastRow = this.getLastRow();
if (col == null){col='A'}
var range = this.getRange(col + lastRow);
if (range.getValue() !== "") {
return lastRow;
} else {
return range.getNextDataCell(SpreadsheetApp.Direction.UP).getRow();
}
};
et tu changes
sh2.getRange(sh2.getLastRow()+1,2).setValue(sh1.getRange(32,4).getValue()); };
en
sh2.getRange(sh2.getLastDataRow('B')+1,2).setValue(sh1.getRange(32,4).getValue()); };