Skip to content

Instantly share code, notes, and snippets.

@timothycarambat
Created May 13, 2019 06:39
Show Gist options
  • Save timothycarambat/7066045361da2f06a6c10affe0c0f3ae to your computer and use it in GitHub Desktop.
Save timothycarambat/7066045361da2f06a6c10affe0c0f3ae to your computer and use it in GitHub Desktop.
Council of Dawn Script for Google Sheet for u/FloppyDingo24. Reddit Request : https://www.reddit.com/r/programmingrequests/comments/bnz8pg/need_a_javascript_google_script_to_hide_and_show/
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var classes = [
"Character Sheet",
"Marauder",
"Warrior",
"Dark Knight",
"Gladiator",
"Paladin",
"Conjurer",
"White Mage",
"Arcanist",
"Scholar",
"Astrologian",
"Pugilist",
"Monk",
"Lancer",
"Dragoon",
"Rogue",
"Ninja",
"Samurai",
"Archer",
"Bard",
"Machinist",
"Summoner",
"Thaumaturge",
"Black Mage",
"Red Mage",
"Garlean Pureblood",
]
var sheet1 = ss.getSheetByName(classes[0]);
var cell1 = sheet1.getRange('B5');
var cell2 = sheet1.getRange('C5');
var cell3 = sheet1.getRange('D5');
classes.map(function(value){
console.log(value)
var sheetOption = ss.getSheetByName(value);
if (cell1.getValue() == value || cell2.getValue() == value || cell3.getValue() == value) {
sheetOption.showSheet()
} else {
sheetOption.hideSheet()
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment