-
Notifications
You must be signed in to change notification settings - Fork 0
/
borders.js
26 lines (21 loc) · 1.03 KB
/
borders.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
/**
The function (addThickBordersToSheets) reformats the sheets called 'TENTATIVE', 'Withdrawn', and 'W/D Other'
by adding borders to improve user experience.
A trigger is set to run addThickBordersToSheets on every change to the spreadsheet.
Point of Contact: Alvaro Gomez, Special Campuses Academic Technology Coach, 210-363-1577
Latest update: 11/21/23
*/
function addThickBordersToSheets() {
var spreadsheet = SpreadsheetApp.getActive();
var sheetsToApplyBorders = ['TENTATIVE', 'Withdrawn', 'W/D Other'];
var rangesToApplyBorders = ['F:F', 'L:L', 'R:R', 'X:X', 'AD:AD', 'AJ:AJ', 'AP:AP', 'AV:AV', 'BB:BB', 'BH:BH'];
for (var s = 0; s < sheetsToApplyBorders.length; s++) {
var sheet = spreadsheet.getSheetByName(sheetsToApplyBorders[s]);
if (sheet) {
for (var i = 0; i < rangesToApplyBorders.length; i++) {
var range = sheet.getRange(rangesToApplyBorders[i]);
range.setBorder(null, true, null, null, null, null, '#000000', SpreadsheetApp.BorderStyle.SOLID_THICK);
}
}
}
}