Reputation: 361
I have the below script that copies an entire row of data to another sheet when condition met.I use checkboxes and whichever checkbox has been checked - the entire row is copied to another sheet.
function onEdit(e) {
var sh=e.range.getSheet();
if(sh.getName()!='TOP UP NEEDED')return
if(e.range.columnStart==18 && e.value=="TRUE") {
var tsh=e.source.getSheetByName("ONLINE RELOCATION");
var trg=tsh.getRange(tsh.getLastRow()+1,1);
sh.getRange(e.range.rowStart,1,1,sh.getLastColumn()).copyTo(trg);
}}
I would like however if it could copy say B:H of that row that have been selected
Hope that is possible
Thanks in advance
Upvotes: 0
Views: 48
Reputation: 862
Sure, you would simply need to alter
sh.getRange(e.range.rowStart,1,1,sh.getLastColumn()).copyTo(trg);
and make it
sh.getRange(e.range.rowStart,2,1,7).copyTo(trg);
Upvotes: 2