-
Notifications
You must be signed in to change notification settings - Fork 0
/
Reformat
39 lines (34 loc) · 2.08 KB
/
Reformat
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
function Hides(){
HideAndDelete();
HideRow();
}
function HideAndDelete() {
var spreadsheet = SpreadsheetApp.getActive();
["1B.NTV-HD","1C.TVB-HD","2A.MAC-SD","3A.TRV-HD & SD","3C.Triple T-SD","4B.AST-HD","4D.AST-DIGITAL","4E.TMNet-HD","5A.ME-HD","5B.SH-HD","5E.ST-HD","5F.PPCTV-SD","5G.WEW-HD","6A.MNC-HD","6C.FIM-HD","6D.TNV-HD","6J.DensTV-HD","6K.NEX-P","7A.SKC-SD","7C.PHP-GEN-SD","7D.CIGNAL-SD","8A.Media-HD","8B.Dhiraagu-HD","11A.Canal+ -HD"].forEach(function (s){
spreadsheet.setActiveSheet(spreadsheet.getSheetByName(s), true);
spreadsheet.getRange('A18:L55').activate();
spreadsheet.getRange('A18:L55').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
spreadsheet.getRange('G:G').activate();
spreadsheet.getActiveSheet().hideColumns(spreadsheet.getActiveRange().getColumn(), spreadsheet.getActiveRange().getNumColumns());
spreadsheet.getRange('A:A').activate();
spreadsheet.getActiveSheet().hideColumns(spreadsheet.getActiveRange().getColumn(), spreadsheet.getActiveRange().getNumColumns());
spreadsheet.getRange('5:16').activate();
spreadsheet.getActiveSheet().hideRows(spreadsheet.getActiveRange().getRow(), spreadsheet.getActiveRange().getNumRows());
spreadsheet.getRange('2:2').activate();
spreadsheet.getActiveSheet().hideRows(spreadsheet.getActiveRange().getRow(), spreadsheet.getActiveRange().getNumRows());
spreadsheet.getRange('K3:L4').activate();
spreadsheet.getActiveRangeList().clear({contentsOnly: true, skipFilteredRows: true});
})
};
function HideRow() {
var ss = SpreadsheetApp.getActive();
["1B.NTV-HD","1C.TVB-HD","2A.MAC-SD","3A.TRV-HD & SD","3C.Triple T-SD","4B.AST-HD","4D.AST-DIGITAL","4E.TMNet-HD","5A.ME-HD","5B.SH-HD","5E.ST-HD","5F.PPCTV-SD","5G.WEW-HD","6A.MNC-HD","6C.FIM-HD","6D.TNV-HD","6J.DensTV-HD","6K.NEX-P","7A.SKC-SD","7C.PHP-GEN-SD","7D.CIGNAL-SD","8A.Media-HD","8B.Dhiraagu-HD","11A.Canal+ -HD"].forEach(function (s){
var sheet = ss.getSheetByName(s);
var values=sheet.getRange(1,1,45,12).getValues();
values.forEach(function(r,i){
if(r[0]=='') {
sheet.hideRows(i+1)
}
});
})
}