-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheck Google Sheet automation bot for Discord
56 lines (40 loc) · 1.49 KB
/
Check Google Sheet automation bot for Discord
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Check Sheet
### The information can be found in {{ sheet }} at cell {{ cell }}.
### Subject: {{ column:C }}
For more details, visit the **__Suggestions__** sheet by clicking here:
{{ url }}
Move rows from one SHEET TO ANOTHER
/*
From LuckyLootTube with Love <3
*/
function onEdit(e){
let range = e.range;
let col = range.getColumn();
let row = range.getRow();
let val = range.getValue();
let source = e.source.getActiveSheet();
if (col == 1 && val != ''){
let ss = SpreadsheetApp.getActiveSpreadsheet();
let sheet = ss.getSheetByName(source.getName());
let targetSheet = ss.getSheetByName(val);
let data = sheet.getRange(row,1,1,sheet.getLastColumn()).getValues();
data[0][0] = '';
targetSheet.appendRow(data[0]);
sheet.deleteRow(row);
}
}
/*
If you need to copy hyperlinks from one sheet to another, use this instead of lines 20-22
let data = sheet.getRange(row,1,1,sheet.getLastColumn()).getRichTextValues();
targetSheet.getRange(targetSheet.getLastRow()+1,1,1,data[0].length).setRichTextValues(data);
targetSheet.getRange(targetSheet.getLastRow(),1).clearContent();
*/
/*
If you need to copy formulas from one sheet to another, add the following code between lines 22 & 23:
let formulas = sheet.getRange(row,1,1,sheet.getLastColumn()).getFormulasR1C1();
for (i=0;i<formulas[0].length;i++){
if (formulas[0][i] != ''){
targetSheet.getRange(targetSheet.getLastRow(),i+1).setFormulaR1C1(formulas[0][i]);
}
}
*/