I'm pretty new to Coding but I'm really struggling with this issue. I need the sheet to auto Copy & Paste to different tabs depending on which option is selected from a dropdown menu. I can get one to work perfectly with the code below:
var sourceSheet = "100 List"
var destinationSheet = "Warm Leads"
var check = {
"col":1,
"changeVal": "Warm Lead",
};
var pasteRange = {
"start": 1,
"cols": 20
};
function onEdit() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet()
if(sheet.getName() === sourceSheet){
//Get active cell
var cell = sheet.getActiveCell();
var cellCol = cell.getColumn();
var cellRow = cell.getRow();
if(cellCol === check.col){
if(cell.getValue() === check.changeVal){
var exportRange = sheet.getRange(cellRow,pasteRange.start,1,pasteRange.cols);
var pasteDestination = ss.getSheetByName(destinationSheet);
var pasteEmptyBottomRow = pasteDestination.getLastRow () +1;
exportRange.copyTo(pasteDestination.getRange(pasteEmptyBottomRow,1),
SpreadsheetApp.CopyPasteType.PASTE_VALUES);
};
};
};
};
However, when I create a separate file, with the alternative version for a different drop-down option only the most recently entered will work on the sheet.
This is the alternate version. Both work separately.
var sourceSheet = "100 List"
var destinationSheet = "Conversations"
var check = {
"col":1,
"changeVal": "DNC",
};
var pasteRange = {
"start": 1,
"cols": 20
};
function onEdit() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet()
if(sheet.getName() === sourceSheet){
//Get active cell
var cell = sheet.getActiveCell();
var cellCol = cell.getColumn();
var cellRow = cell.getRow();
if(cellCol === check.col){
if(cell.getValue() === check.changeVal){
var exportRange = sheet.getRange(cellRow,pasteRange.start,1,pasteRange.cols);
var pasteDestination = ss.getSheetByName(destinationSheet);
var pasteEmptyBottomRow = pasteDestination.getLastRow () +1;
exportRange.copyTo(pasteDestination.getRange(pasteEmptyBottomRow,1),
SpreadsheetApp.CopyPasteType.PASTE_VALUES);
};
};
};
};
I have tried creating two separate edit requests similar to below and putting them both on the same file but I could still only get one function to run.
function onEdit()
{
onEdit1();
onEdit2();
}
Any help would be really appreciated as I feel like I'm now going round and round in circles.


