I am trying to get a spreadsheet with a lot of columns to hide some of them based on the currently selected cell/column.
Example: Say columns C-R are grouped in 3's (C-D-E, F-G-H, ....). I only want to see the first column in each group unless a cell in the group is selected. If a cell in column F, G or H is selected I want to see these column.
|__A__|__B__|__C__|__F__|__G__|__H__|__I__|__L__|__M__|__P__|
Now I've got a script that can hide and show groups however I need to find a way to trigger the function. The closest I have found managed is to trigger onChange
but this requires there to be a change in the cell, I want selection to be enough.
function onSelect(){
code for cell check and showing and hiding columns here.
}
Any ideas in how, one could accomplish such a trigger?