0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

スプレッドシートのセル内にある特定の文字列を探索する

Posted at

前提

GAS

内容

forループを入れ子にして、縦横方向に探索しました。

function searchKeyword() {
  const UI = SpreadsheetApp.getUi();
  const ThisSpread = SpreadsheetApp.getActiveSpreadsheet();
  const BeSearchedSheet = ThisSpread.getSheetByName('sheet5');
  for (let vertical = 1; vertical<=3; vertical++){
    for(let horizontal = 1; horizontal <= 3; horizontal++){
      let search_node = BeSearchedSheet.getRange(vertical, horizontal).getValue();
      if(search_node.match('here!')){
         UI.alert('i did it ! => ' + 'vertical:' + vertical + 'horizontal:' + horizontal);
         break;
         }
    }
  }
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?