Sorry, a total newby to Google Sheets here, but with reasonable vba experience.
I'm trying to create an active list of active users in a hidden sheet that could then be used to highlight the existence of those users with a conditional format and vlookup.
Can this work in Sheets?
So far, I have the code below, but it's early days, and this only seems to list the one user that activated the code, rather than all. I think I can see why that is but I'm finding it really difficult to find resources to help me along (again - a newby to Sheets).
function GetUserNames() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sht = ss.getSheetByName("ActiveUsers");
// Log the email address of the person running the script.
var email = Session.getActiveUser().getEmail();
Logger.log(email);
//SET CELL A1 TO EMAIL ADDRESS OF ACTIVE USERS
sht.getRange(1,1).setValue(email);
}
My plan is to run this with a From spreadsheet - On open trigger. Is that the preferred option for such things? I haven't begun to look at the hidden sheet aspect but presume that will work OK, even if my script has to un-hide/re-hide it each time?