This file contains hidden or 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 |
This file contains hidden or 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 specificDataRookie() { | |
| // get active spreadsheet | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| // get active sheet | |
| var sheet = ss.getActiveSheet(); | |
| // get active cell | |
| var activeCell = sheet.getActiveCell(); |
This file contains hidden or 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 specificDataImproved() { | |
| // get active spreadsheet | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| // get active sheet | |
| var sheet = ss.getActiveSheet(); | |
| // get active cell | |
| var activeCell = sheet.getActiveCell(); |
This file contains hidden or 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 archiveData() { | |
| // get active spreadsheet | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| // get source sheet by name | |
| var sourceSheet = ss.getSheetByName('Students'); | |
| // get destination sheet by name | |
| var destSheet = ss.getSheetByName('archive'); |
This file contains hidden or 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 getColByName(name) { | |
| // get column headers as an array to search through | |
| var headers = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Students').getDataRange().getValues().shift(); | |
| // search array looking for specific text to return its position | |
| var colindex = headers.indexOf(name); | |
| return colindex+1; | |
This file contains hidden or 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 getAssigneeDetails() { | |
| // get 'Plan' sheet | |
| var planSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Plan'); | |
| // get 'Plan' sheet data range | |
| var planDataRange = planSheet.getDataRange(); | |
| // get 'Plan' sheet data values | |
| var planData = planDataRange.getValues(); | |
| // get number of last row of data in 'Plan' sheet | |
| var planLastRow = planSheet.getLastRow(); |
This file contains hidden or 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 getStartDate() { | |
| // get 'Plan' sheet | |
| var planSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Plan'); | |
| // get 'Plan' sheet data range | |
| var planDataRange = planSheet.getDataRange(); | |
| // get 'Plan' sheet data values | |
| var planData = planDataRange.getValues(); | |
| // get number of last row of data in 'Plan' sheet | |
| var planLastRow = planSheet.getLastRow(); |
This file contains hidden or 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 lookupEmailAddress() { | |
| // get 'Plan' sheet | |
| var planSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Plan'); | |
| // get 'Plan' sheet data range | |
| var planDataRange = planSheet.getDataRange(); | |
| // get 'Plan' sheet data values | |
| var planData = planDataRange.getValues(); | |
| // get number of last row of data in 'Plan' sheet | |
| var planLastRow = planSheet.getLastRow(); |
This file contains hidden or 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 createEventFromSheet() { | |
| // get 'Plan' sheet | |
| var planSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Plan'); | |
| // get 'Plan' sheet data range | |
| var planDataRange = planSheet.getDataRange(); | |
| // get 'Plan' sheet data values | |
| var planData = planDataRange.getValues(); | |
| // get number of last row of data in 'Plan' sheet | |
| var planLastRow = planSheet.getLastRow(); |
This file contains hidden or 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 onFormSubmit(e) { | |
| // get spreadsheet info | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var dataSheet = ss.getSheetByName('Form responses 4'); | |
| // get Form data | |
| var formValues = e.namedValues; // allows row Headers to be specified when looking-up values | |
| var theRow = e.range.getRow(); // this is the row the Form data is written to | |
| var name = formValues['Name']; |
OlderNewer