0
votes

I have posted this before with my own script and I got some amazing responses but they didn't work fully I am hoping someone can help with a better script

Sample Sheet

The columns will stay the same but I will load data into the area. I am looking to have it when you select the option 'List 1' or 'List 2' or Etc in the Assigned to the column it will move the row to a page with that same name. The new sheets will have the same headers at the top. I can get it to work myself for the one list but I am at a loss for how to make it for multiple lists.

I am hoping to find one that either works on edit or after running the script.

Thanks in advance and please ask any questions I will do my best to answer

1
on you trigger, get the edited assigned, if the assigned is your permitted name, for example List 1, you check this assigned name to sheets collection, if not found, create new, then copy this row to the new assigned sheet, and delete this row from the source - user11982798

1 Answers

1
votes

Try this:

function onEdit(e) {
  var sh=e.range.getSheet();
  if(sh.getName()=='Your Sheet Name' && e.range.columnStart==6)  {
    var v=sh.getRange(e.range.rowStart,1,1,sh.getLastColumn()).getValues();
    var tsh=e.source.getSheetByName(e.value);
    if(tsh) {
      tsh.getRange(tsh.getLastRow() + 1,1,1,v[0].length).setValues(v);
    }
  }
}