Skip to content

Instantly share code, notes, and snippets.

@Tomokatsu-Sakamoto
Created February 12, 2022 14:52
Show Gist options
  • Save Tomokatsu-Sakamoto/7c58f1523a7eb1554a9e71b962d6723b to your computer and use it in GitHub Desktop.
Save Tomokatsu-Sakamoto/7c58f1523a7eb1554a9e71b962d6723b to your computer and use it in GitHub Desktop.
/** @OnlyCurrentDoc */
function myFunction() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('A1').activate();
spreadsheet.getCurrentCell().setValue('1');
spreadsheet.getRange('B2').activate();
spreadsheet.getCurrentCell().setValue('2');
spreadsheet.getRange('C3').activate();
spreadsheet.getCurrentCell().setValue('3');
spreadsheet.getRange('C4').activate();
};
function myFunction1() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getCurrentCell().setValue('1');
spreadsheet.getCurrentCell().offset(1, 1).activate();
spreadsheet.getCurrentCell().setValue('2');
spreadsheet.getCurrentCell().offset(1, 1).activate();
spreadsheet.getCurrentCell().setValue('3');
spreadsheet.getCurrentCell().offset(1, 0).activate();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment