Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Google spreadsheet with my monthly balance sheet for my company. I keep track of estimated and actual like this:

Expense | Jan11 Actual | Jan11 Estimate | Dec10 Actual | Dec10 Estimate | etc...

I would love it if I could easily hide all the Estimate columns with a touch of a button, and turn them on with another touch.

How can I do this?

share|improve this question

Google Apps Script can do it.

This should get you started:

function onOpen() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var menuEntries = [ {name: "Hide", functionName: "myFunction"} ];
  ss.addMenu("Scripts", menuEntries);

function myFunction() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var colCount = sheet.getMaxColumns();
  var x;
  for ( x = 1; x < colCount; x = x + 2) {
    var r = sheet.getRange(1,x);
share|improve this answer
did this really work? – Werner Nov 1 '15 at 15:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.