Last active
December 16, 2018 21:04
-
-
Save phillypb/c4215a1b8da5287a524f82c87c6ee9bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getActiveCell() { | |
// get the active spreadsheet and sheet | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); // ss contains entire spreadsheet | |
var sheet = ss.getActiveSheet(); // sheet contains current active sheet ('Students') | |
// from sheet, get active cell and store as variable | |
var activeCell = sheet.getActiveCell(); | |
// from activeCell, get value and store as variable | |
var cellValue = activeCell.getValue(); | |
// show value of cellValue | |
Logger.log(cellValue); | |
// from activeCell, also show row number | |
var cellRow = activeCell.getRow(); | |
Logger.log(cellRow); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment