In my google spreadsheet A, I use a combination of the TRANSPOSE and IMPORTRANGE formulas to import data from calendar spreadsheet B, in order to fill out a working schedule for events. Because on each date there are 3 event slots, which are not always filled, I am getting a lot of obsolete columns.
Table layout:
row1: 01-01-2013 01-01-2013 01-01-2013 02-01-2013
row2: Event_ID Event_ID Event_ID Event_ID
row3: Event_name Event_name Event_name Event_name
Rows 1 and 2 contain auto-generated dates and event_ID’s so these are never empty. Cell nr. 3 displays empty when there was no event added to that slot, but in fact there is a CONTINUE-formula in there to continue the importrange-formula from cell A1.
I´m looking for a script to automatically hide the colums in which cell nr. 3 doesn’t contain imported data.
Not understanding a thing about JavaScript (but willing to learn), I have tried to combine pieces from existing scripts but at this point I cannot manage to make any sense of these codes…
The following code does the trick:
See example file I prepared to watch it in action: Hide columns based on cell value