0
votes

Here is a spreadsheet I have created

https://docs.google.com/spreadsheets/d/1_HQJ2UK6R3QTLY9oeVe-PIaZngPN1luQAz633taE4Oo/edit?usp=sharing

I'm trying to make it so that if a task is "assigned to" a person from the drop down list on the "To Do" sheet, it pushes it to the relevantly titled person's sheet onedit.

Is there any way I can do this? Thank you for your help!

1
It is doable. You can refer to this page which might be helpful : productforums.google.com/forum/#!topic/docs/hR40qh02UWEKRR
Look at the documentation for the spreadsheet service: Apps Script Spreadsheet ServiceAlan Wells
@KRR that is very similar, but I need it to move to the sheet of the entry that's the name of the entry chosen.Kwesi

1 Answers

1
votes

It seems like this post is connected to this topic you posted earlier If it is, you can extend the script I provided earlier to also work for edits done on the sheet 'To Do'.

Please see, if this works for you:

function onEdit(e) {
var ss = e.source,
    s = ss.getActiveSheet(),
    sheets = ["To Do", "Beau", "Derek", "Jay", "Steven", "Terence", "Victor"],
    ind = sheets.indexOf(s.getName());
if (ind === 0 && e.range.columnStart === 6 && e.range.rowStart > 4) {
    ss.getSheetByName(e.value).appendRow(
        e.range.offset(0, -5, 1, 6).getValues()[0])
    s.deleteRow(e.range.rowStart);
} else if (ind > 0 && e.range.columnStart === 1 && e.value === 'yes') {
    ss.getSheetByName('Complete Tasks')
        .appendRow(e.range.offset(0, 0, 1, 7)
            .getValues()[0])
    s.deleteRow(e.range.rowStart);
}
}

NOTE: I noticed you changed the 'e' to 'o'. This will lead to a non-working script. 'e' is not just a random letter, but represents an event object. More info on event objects