dimanche 26 novembre 2023

When checkbox is marked "TRUE" in the specific data row in sheet - all data of that specific row from A:AA are copied in "Data_base" sheet

The issue that specific row checkbox "TRUE" in different sheets (example "Data1", Data2", "Data3") could be in different row (example row 28, row 40, row 100, but all the time the checkbox will be in the same column E and just 1 in all the sheet in that E column. Its needed to copy data from the active sheet to last empty row of "Data base" sheet, when check box is selected "TRUE" in column E. The data A:AA all the time are in the same row where checkbox was selected.

function onEdit(e) {
  e.source.getActiveSheet().getName() == 'Data1' && e.range.getColumn() == 5 && e.value == "TRUE" ?
    (e.source.getSheetByName('Data_base').appendRow([e.source.getSheetByName('Data1').getRange('A' + e.range.getRow()).getValue()]) ?
    (e.source.getSheetByName('Data1').getRange('B' + e.range.getRow()).copyTo(e.source.getSheetByName('Data_base').getRange('B' + e.source.getSheetByName('Data_base').dest.getLastRow()+1;
}



Aucun commentaire:

Enregistrer un commentaire