I know that using these function I can show and hide columns:
function showColumns() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); sheet.showColumns(2,3); // B-D, three columns starting from 2nd sheet.showColumn(7); // G, column number 7 } function hideColumns() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); sheet.hideColumns(2,3); // B-D, three columns starting from 2nd sheet.hideColumn(7); // G, column 7 } But for that, iI need two buttons or menu script, one for hiding and one for showing the columns.
I would like to know if there is a "toggle" function that exist so I can activate the hide/show function without needing 2 buttons or menu items.
Any idea? :)
Thanks!
B.