function copyRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First row of data to process
var numRows = sheet.getLastRow() - 1; // Number of rows to process
// Fetch the range of cells A2:B3
var dataRange = sheet.getRange(startRow, 1, numRows, 100);
dataRange.activate();
// Fetch values for each row in the Range.
var data = dataRange.getValues();
for (var i = 0; i < data.length; ++i) {
var row = data[i];
var emailAddress = row[1]; // First Column
var title = row[6];
if (title.contains("SVP" || "VP" || "Director" || "director" || "CEO" || "Founder" || "owner")) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var destination = ss.getSheetByName("Director's, VP's, CEOs, SVP's - MANUAL");
var range = destination.getRange("A2:D1000");
row.copyValuesToRange(startRow, 1, numRows, 100);
}
}
}
Here's a screenshot of the spreadsheet:
Not sure what I'm missing, but the code doesn't seem to be working... Saying that it's having an error:
Cannot find function contains in object Associate Account Strategist.