[]
You can choose whether to hide or show rows and columns in a worksheet by using the setHidden method of the IRange interface.
Refer to the following example code in order to hide specific rows and columns in a worksheet.
worksheet.getRange("E1").setValue(1);
// Hide row 2:6 using the setHidden method.
worksheet.getRange("2:6").setHidden(true);
// Hide column A:D using the sethidden method.
worksheet.getRange("A:D").setHidden(true);