任何人都可以帮我处理我的剧本。
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var December = ss.getSheetByName("12");
var range = December.getRange("A:A");
var emailRange = range.getValues();
var Form1 = ss.getSheetByName("Form Responses 1");
var emailList = Form1.getRange("K:K").getValues();
for(x in emailRange)
{
if(x == 0)
continue
var email = emailRange[x];
if(email == "")
break;
j = 1
for(i in emailList)
{
var row = emailList[i];
if(row == "")
{
break;
}
SpreadsheetApp.getUi().alert(email + " - " + row);
if(row == email)
SpreadsheetApp.getUi().alert("OK");
}
}
if语句if(row == email)
无效。我使用了debug,变量是相同的,但它仍然没有得到。
答案 0 :(得分:0)
将if(row == email)替换为if(row [0] == email [0])
row
和email
属于数组类型。你应该比较他们的元素。