Skip to main content
deleted 37 characters in body; edited tags
Source Link
user3717023
user3717023

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.

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, i 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.

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, I 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.

Source Link

Google Spreadsheet script "toggle" hide/view column/row

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, i 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.