1
votes

The recorded macro looks like this:

 function Unhide() {
    var spreadsheet = SpreadsheetApp.getActive();
      spreadsheet.getRange('A:P').activate();
      spreadsheet.getActiveSheet().showColumns(0, 16);
    };

When trying to execute the macro it stops and shows the following error message:

Exception: Those columns are out of bounds

1
How many columns do you have in your sheet ? - soMarios

1 Answers

2
votes

Try switching your starting index of showColumns() to 1.

function Unhide() {
var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getRange('A:P').activate();
  spreadsheet.getActiveSheet().showColumns(1, 16);
};