-
Notifications
You must be signed in to change notification settings - Fork 3
/
RefreshData.js
58 lines (36 loc) · 1.03 KB
/
RefreshData.js
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
57
58
function refreshData() {
SpreadsheetApp.flush()
refreshData1()
refreshData2()
refreshData3()
}
function refreshData1 () {
// Load sheet with variable
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Utility');
var cell = sheet.getRange('Utility!B3');
var cell2 = sheet.getRange('Utility!C3');
//Change Value To 0
cell.setValue(0);
cell2.setValue(0);
}
function refreshData2(){
//Load sheet with variable
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Utility');
var cell = sheet.getRange('Utility!B3');
//Time delay before changing back
Utilities.sleep(2000)
//Set Value Back to 1
cell.setValue(1);
}
function refreshData3(){
//Load sheet with variable
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Utility');
var cell2 = sheet.getRange('Utility!C3');
//Time delay before changing back
Utilities.sleep(2000)
//Set Value Back to 1
cell2.setValue(1);
}