Is there a way, to make certain rows in Google Spreadsheets, be editable and accessible to a certain user, while not be accessible to another user?
I have a spreadsheet which 70 or so people need to access and input their data into the rows that are allocated to them. Previously, I just protected each row so that they couldn't edit anyone else's rows but ideally I would also like to hide everyone else's rows. Example spreadsheet here.
At the moment, I've tried to use a script to hide and show certain rows depending on the email address of the person accessing the spreadsheet. However, this affects the view of everyone looking at the spreadsheet currently. My code is:
function onOpen(e){
var email = (Session.getEffectiveUser().getEmail());
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
switch (email){
case '[email protected]':
sheet.hideRows(7, sheet.getMaxRows()-6);
break;
case '[email protected]':
sheet.hideRows(2, 5);
sheet.showRows(7, 5);
sheet.hideRows(12, sheet.getMaxRows()-11);
break;
case '[email protected]':
sheet.hideRows(2, 10);
sheet.showRows(12, 5);
sheet.hideRows(17, sheet.getMaxRows()-16);
break;
...etc.
My question is: is there a way to make these views viewer-specific rather than global? Or am I doomed to go through each row and just use the protection feature every time I need to generate this spreadsheet?