D
Пример https://docs.google.com/spreadsheets/d/1uEwaYAOfPaR8eVxQMF3dwTzX32TF_l7FmX8FI2zguEE/edit?usp=sharing
нужно искать по совпадению слово "мир"
Size: a a a
D
V
D
D
V
V
D
V
D
function matchRange() {
let sheet = SpreadsheetApp.getActive().getSheets()[0];
let range = sheet.getRange(`A2:A${sheet.getLastRow()}`);
values = range.getValues();
let re = 'мир'
let matchedRanges = [];
values.reduce((acc, v, i) => {
if (v[0].search(re) !== -1) {
acc.push(`A${i}`)
}
return acc
}, matchedRanges)
Logger.log(matchedRanges)
return matchedRanges
}
РИ
var array=SpreadsheetApp.getActive().getActiveSheet().getRange('A1:A').getValues().reduce(function(acc,row,index){
if(row[0].toLowerCase().indexOf('мир')>=0){acc.push(index)}
return acc},[])
V
function matchRange() {
let sheet = SpreadsheetApp.getActive().getSheets()[0];
let range = sheet.getRange(`A2:A${sheet.getLastRow()}`);
values = range.getValues();
let re = 'мир'
let matchedRanges = [];
values.reduce((acc, v, i) => {
if (v[0].search(re) !== -1) {
acc.push(`A${i}`)
}
return acc
}, matchedRanges)
Logger.log(matchedRanges)
return matchedRanges
}
V
function matchRange() {
let sheet = SpreadsheetApp.getActive().getSheets()[0];
let range = sheet.getRange(`A2:A${sheet.getLastRow()}`);
values = range.getValues();
let re = 'мир'
let matchedRanges = [];
values.reduce((acc, v, i) => {
if (v[0].search(re) !== -1) {
acc.push(`A${i}`)
}
return acc
}, matchedRanges)
Logger.log(matchedRanges)
return matchedRanges
}
D
var array=SpreadsheetApp.getActive().getActiveSheet().getRange('A1:A').getValues().reduce(function(acc,row,index){
if(row[0].toLowerCase().indexOf('мир')>=0){acc.push(index)}
return acc},[])
V
var array=SpreadsheetApp.getActive().getActiveSheet().getRange('A1:A').getValues().reduce(function(acc,row,index){
if(row[0].toLowerCase().indexOf('мир')>=0){acc.push(index)}
return acc},[])
EN
var array=SpreadsheetApp.getActive().getActiveSheet().getRange('A1:A').getValues().reduce(function(acc,row,index){
if(row[0].toLowerCase().indexOf('мир')>=0){acc.push(index)}
return acc},[])
T
A
char(10)
VP
T
char(10)
T