Tutorial by Examples: actives

Using ActiveCell or ActiveSheet can be source of mistakes if (for any reason) the code is executed in the wrong place. ActiveCell.Value = "Hello" 'will place "Hello" in the cell that is currently selected Cells(1, 1).Value = "Hello" 'will always place "Hello&...
Stashing takes the dirty state of your working directory – that is, your modified tracked files and staged changes – and saves it on a stack of unfinished changes that you can reapply at any time. Stashing only modified files: Suppose you don't want to stash the staged files and only stash the mod...
This returns the currently active spreadsheet, or null if there is none. var currentSheet = SpreadsheetApp.getActive(); var url = currentSheet.getUrl(); Logger.log( url );

Page 1 of 1