-
Notifications
You must be signed in to change notification settings - Fork 0
/
Root.gz
132 lines (98 loc) · 3.24 KB
/
Root.gz
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//Important file
/** @OnlyCurrentDoc */
function header() {
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
sheet.getRange(
spreadsheet.getCurrentCell().getRow() , 1, 1, 1).activate();
spreadsheet.getActiveRangeList().setBackground('#4c1130')
.setFontColor('#ffffff')
.setFontWeight('bold');
spreadsheet.getActiveSheet().setFrozenRows(1);
};
function check() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('2:2').activate();
spreadsheet.getActiveRangeList().setFontStyle('italic')
.setFontColor('#999999')
.setFontWeight('bold');
};
function Header2(){
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
sheet.getRange(
spreadsheet.getCurrentCell().getRow(),
1, 1, sheet.getMaxColumns()).activate();
spreadsheet.getActiveRangeList().setBackground('#4c1130')
.setFontColor('#ffffff')
.setFontWeight('bold');
spreadsheet.getActiveSheet().setFrozenRows(1);
};
function cell() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('8:8').activate();
spreadsheet.getActiveRangeList().setFontWeight('bold');
};
// Update data in different sheets
function newsheetvalue()
{
var targetsheet = SpreadhsheetApp.getActiveSpreadsheet().getSheetByName("sheet2");
targetsheet.getRange(1,1).setValue(1);
}
// Clear the mess
function clearmess()
{
var app = SpreadsheetApp.getActiveSpreadsheet();
var sheet = app.getActiveSheet();
acitveSheet.getRange("A1:F11").clearContent();
// OR
activeSheet.getRange("A1:F11").clear();
// OR
activeSheet.getRange("A1:F11").clearFormat();
}
function removevalues() {
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns()).activate();
spreadsheet.getActiveRangeList().clear({contentsOnly: true, skipFilteredRows: true});
};
function setvalue() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('C19').activate();
spreadsheet.getCurrentCell().setValue('vsbsh');
spreadsheet.getRange('E21').activate();
};
//GET RANGE OF VALUES
function getRange()
{
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
var temp = sheet.getRange("A2:B12").getValues();
Logger.log(temp);
//an array is returned = [[],[],[]]
sheet.getRange("A22:B32").setValues(temp);
}
function ViewData()
{
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
Logger.log(sheet.getCurrentCell().getRow());
Logger.log(sheet.getCurrentCell().getColumn());
//Logger.log(sheet.getCurrentCell().getCell(rowIndex, columnIndex));
}
function loopAddData()
{
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
var lr = sheet.getLastRow();
Logger.log(lr);
var data = sheet.getRange("A2:E5").getValues();
Logger.log(data.length);
Logger.log(data[0].length)
Logger.log(data)
for(var i=0;i<data.length;i++)
{
Logger.log(data[i]);
}
sheet.getRange(sheet.getCurrentCell().getRow(),sheet.getCurrentCell().getColumn(),data.length,data[0].length).setValue(data);
}