Skip to content

Instantly share code, notes, and snippets.

@VTRyo
Created August 16, 2021 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VTRyo/2a8070384863b3f1d0e096250a357d1d to your computer and use it in GitHub Desktop.
Save VTRyo/2a8070384863b3f1d0e096250a357d1d to your computer and use it in GitHub Desktop.
SpreadSheet Base Settings
//アクティブシートの取得
spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
sheetname = 'シート1'
sheet = spreadsheet.getSheetByName(sheetname)
//最終行の取得
lastRow = sheet.getLastRow()
//よくある存在する行分ループするやつ
//この場合のlineNumは行番号を入れるとどの行から始めるか変更できる
function getItemValues(lineNum) {
for (var i = lineNum; i <= lastRow;) {
items = sheet.getRange(i,1).getValue();
i++
console.log(items)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment