An answer was provided in this question: webapps: Cell reference with colour formatting for doing so within a tab, but not across tabs. Does anyone have suggestions for a script that will work across tabs?
Asking for a teacher friend that wants to combine attendance/roster from multiple tabs (classes) into one master tab.
I have created a sample google sheet that shows how I am able to reference cells from other tabs in the "Master" tab with a simple "=" formula, here: https://docs.google.com/spreadsheets/d/1nMvs5-PWenGcOCNnA9rKnhGo-yAjjLNY07dhoR6-fCw/edit?usp=sharing.
The goals is that when I link to a cell from the other tab, the formatting of that cell should be retained. Particularly, this is helpful for teachers that highlight specific words in a student/participant's name when trying to remember that student's name. They are able to do so on individual rosters, but not on a comprehensive list by simply linking to that cell. They would have to instead copy/paste formatting from the individual tab each time, which can become cumbersome with greater number of classes.
Best Answer
You have a series of Class sheets in which the student name may be formatted by the teacher. You also have a Master sheet where the names of the students in each class are linked by formula. Your goal is to apply any formatting from the Class sheet to the equivalent student/class on the Master sheet.
There are many ways in which your scenario might be answered. Please consider this as just one solution.
The referenced question used a custom formula to apply the formatting in a limited case scenario on a single sheet. In this case, given the number of classes and the number students, I was concerned about the possible overhead on the spreadsheet if the same approach (custom function) was used. In addition, the student name formatting is unlikely to change regularly throughout the day, so I judged that a immediate/real-time update was not essential.
On the Master, I also moved the student names down by one row so that their position aligned with the other sheets - all student names (on every sheet) now begin on row 5.
The script uses a simple
onedit(e)
trigger. I have added acheckbox
on the Master sheet. When the user wishes to update the student name formats on the Master, simply check the checkbox. When the process is complete, the checkbox value reverts to unchecked/(blank), ready for the next update.Before
After