Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onEdit(e) {
- const sheetName = 'Data';
- const startRow = 5;
- const startColumn = 2;
- const endRow = 28;
- const endColumn = 20;
- const currentRow = e.range.getRow();
- const currentColumn = e.range.getColumn()
- if (e.source.getActiveSheet().getName() == sheetName && typeof e.value == 'string'){
- console.log('Sheet true')
- if (currentRow >= startRow && currentRow <= endRow && currentColumn >= startColumn && currentColumn <= endColumn) {
- console.log('inside range')
- const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName)
- const columnUlastRow = sheet.getRange("U1").getNextDataCell(SpreadsheetApp.Direction.DOWN).getRow()
- sheet.getRange(columnUlastRow+1,21).setValue(e.value)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement