I want to share the sheet with others but i also want them to not able to see some columns. Is there any way out to solve this using google apps script or if any alternate option for the same. Thank you.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You should take a look at the documentation, it will help you to find the function you're looking for. In this case, you need the Sheet.hideColumns(columnIndex) method
hideColumns(columnIndex)
Hides the column at the given index.
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
// Hides the first column
sheet.hideColumns(1);
回答2:
Very simple function
function onOpen(){
ss = SpreadsheetApp.openById( 'sheetid' ),
sheet = ss.getSheetByName('sheet_name'),
ss.getActiveCell();
sheet.hideColumns(start_column_number, end_column_number);
}