In Google sheets, am I able to have a master sheet that controls what Leverships participants see in their workbooks? For example, I want the participants to only see columns A to D when they do the first part of the exercise, then I can "reveal" column E for the next part of the exercise, and then I can reveal columns F to I for the last part of the exercise. I envision having something in a master spreadsheet that I can click checkboxes to reveal the columns. I don't want them to have access to those columns until I reveal them.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
You can control what columns participants see in their Google Sheets workbooks by using a master sheet with checkboxes and a Google Apps Script. Here's how to do it with separate workbooks:
Master Sheet Setup:
Create checkboxes in the master sheet to control column visibility.
List all participant workbook IDs in the master sheet.
Script Setup:
Write a script in the master sheet that triggers when checkboxes are toggled.
The script will open each participant's workbook and hide or show columns based on the checkbox states.
Permissions:
Ensure all participant workbooks are shared with the master sheet's owner with edit permissions.
Alternatively, if all participants work within the same Google Sheet file (with separate tabs for each participant), the script can control column visibility across all tabs based on checkboxes in the master sheet, simplifying the process.
Here's a basic script outline for the single shared sheet approach:
javascript
function onEdit(e) {
var range = e.range;
var sheet = range.getSheet();
if (sheet.getName() === "Master" && range.getColumn() === 1) {
var checkboxValue = range.getValue();
var columnToToggle;
if (range.getRow() === 2) {
columnToToggle = 'E'; // For the first checkbox
} else if (range.getRow() === 3) {
columnToToggle = 'F:I'; // For the second checkbox
}
var allSheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
var participantSheets = allSheets.filter(function(sheet) {
return sheet.getName() !== "Master";
});
participantSheets.forEach(function(sheet) {
if (checkboxValue) {
sheet.showColumns(columnToToggle);
} else {
sheet.hideColumns(columnToToggle);
}
});
}
}
This approach is simpler and avoids the need to manage permissions across multiple files. If separate workbooks are necessary, ensure all workbooks are shared with the master sheet's owner with edit permissions and use a similar script to control column visibility across multiple files.