Maintenant dans le meme principe je voudrais copier un bloc de cellules C2:H18 du fichier A vers la 1ere cellule vide de la colonne J du fichier B
voici mon code:
function copie3() {
var ss1 = SpreadsheetApp.openById(getFileId("A")).getSheetByName('Feuille 1');
var ss2 = SpreadsheetApp.openById(getFileId("B")).getSheetByName('Feuille 1');
var ligne = ss2.getRange('J2').getNextDataCell(SpreadsheetApp.Direction.DOWN).getRow() + 1
ss2.getRange("J" + ligne + ":O" + ligne).setValues(ss1.getRange("C2:H18").getValues());
};
Ca ne marche pas.
Voici l erreur:
15:54:02 Erreur
Exception: The number of rows in the data does not match the number of rows in the range. The data has 17 but the range has 1.
pepe @ Code.gs:3358