Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Google Sheet Last Cell Edit Focus
- -------------------------------------------------
- function setTrigger() {
- var ss = SpreadsheetApp.getActive();
- ScriptApp.newTrigger("myFunction").forSpreadsheet(ss).onEdit().create();
- }
- function myFunction() {
- var sheet = SpreadsheetApp.getActiveSheet();
- var sName = sheet.getName();
- var currentCell = sheet.getActiveCell().getA1Notation();
- UserProperties.setProperty("mySheetName", sName);
- UserProperties.setProperty("myCell", currentCell);
- }
- function onOpen() {
- var lastModifiedSheet = UserProperties.getProperty("mySheetName");
- var lastModifiedCell = UserProperties.getProperty("myCell");
- SpreadsheetApp.getActiveSpreadsheet().getSheetByName(lastModifiedSheet).getRange(lastModifiedCell).activate();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement