Google Apps Scriptで文字列を検索する

概要

特定の文字列を検索して、その結果を取得したい場合

セルを返す

var searchKey = "検索対象の文字列";
var textFinder = mySheet.createTextFinder(searchKey);
var allCel = textFinder.findAll();
var resCel = allCel[0].getA1Notation();
Logger.log(resCel);

返ってきた結果

[20-01-07 17:34:16:954 JST] B6

参考URL

https://developers.google.com/apps-script/reference/spreadsheet/text-finder#getCurrentMatch()
https://qiita.com/wezardnet/items/210eafa0530ec0c4a2c7