Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myFunction() {
- var SHEETNUMBER = 1
- var ss = SpreadsheetApp.openById("1UJtHMg58-SybeqwMPVD6eKG6cWPuePIYTCd7uJfigTU");
- var values = ss.getSheetValues(1, 20, 50, 5);
- var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
- var newss = SpreadsheetApp.setActiveSheet(sheets[SHEETNUMBER-1]);
- newss.deleteRows(1, 100)
- for (var j=7; j < values.length; j++) {
- newss.appendRow(values[j]);
- }
- var endRow = SpreadsheetApp.getActiveSheet().getLastRow();
- var range = newss.getDataRange();
- for (var i = 1; i < range.getLastRow() + 1; i++){
- var status = newss.getRange(i, 2).getValue();
- var rowRange = newss.getRange(i, 1, 1, 5);
- if (status == 'Shaman') {
- rowRange.setBackgroundColor("#0070DE");
- } else if (status == 'Warrior') {
- rowRange.setBackgroundColor("#C79C6E");
- } else if (status == 'Paladin') {
- rowRange.setBackgroundColor("#F58CBA");
- } else if (status == 'Hunter') {
- rowRange.setBackgroundColor("#ABD473");
- } else if (status == 'Rogue') {
- rowRange.setBackgroundColor("#FFF569");
- } else if (status == 'Priest') {
- rowRange.setBackgroundColor("#FFFFFF");
- } else if (status == 'Death Knight') {
- rowRange.setBackgroundColor("#C41F3B");
- } else if (status == 'Mage') {
- rowRange.setBackgroundColor("#69CCF0");
- } else if (status == 'Warlock') {
- rowRange.setBackgroundColor("#9482C9");
- } else if (status == 'Monk') {
- rowRange.setBackgroundColor("#00FF96");
- } else if (status == 'Druid') {
- rowRange.setBackgroundColor("#FF7D0A");
- } else if (status == '') {
- rowRange.setBackgroundColor("#FFFFFF");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement