var city=new Array();
var c=new Array();
function myFunction() {
ex = SpreadsheetApp.openById("1TFLNvuVfrCniFAzonededVw4pwT7xyAT_KkYT1jE-Rc");
dicnumber=0;
for(tr=19;tr<29;tr++){
sh = ex.getSheetByName(tr);
var v=sh.getRange(1,1,100,50).getValues();
de="柏市";
den="人口(住民基本台帳登録人口)";
for(s=1;s<100;s++){
str=""+v[s][0];
if(str.indexOf("中核")>-1)str="";
if(str.indexOf("平均")>-1)str="";
if(str.indexOf("柏")>-1)str="柏市";
city[s]=str;
}
cityline=0;
for(s=1;s<100;s++){
if(city[s]==de)cityline=s;
}
creditline=0;
for(s=1;s<100;s++){
if(city[s]==de)cityline=s;
}
for(s=1;s<40;s++){
c[s]=v[0][s];
if(c[s].indexOf("項目")>-1)c[s]="";
for(sx=1;sx<11;sx++){
c[s]=c[s].replace(" ","");
c[s]=c[s].replace(" ","");
c[s]=c[s].replace(" ","");
c[s]=c[s].replace(" ","");
c[s]=c[s].replace(" ","");
c[s]=c[s].replace(" ","");
}
}
creditline=0;
for(s=1;s<40;s++){
if(c[s]==den)creditline=s;
}
var ex2 = SpreadsheetApp.getActiveSpreadsheet();
var sh2 =ex2.getActiveSheet();
p1=v[cityline][creditline];
sh2.getRange(tr,1).setValue(tr);
sh2.getRange(tr,2).setValue(p1);
}
}
最終更新:2017年08月16日 06:49