google apps script - Group by Row Categories -
i'm trying write script collect each group category rows. each category have different amount of items. i'd love able identify last row each category can create script add new row specific category.
i don't want rely on categories number of row. rather background color of each title.
here's document: https://docs.google.com/a/helloinnovation.com/spreadsheets/d/1mwlb_si29kkqbdfauxuee6zmztu0d1j2pxlwa8purqs/edit?usp=sharing
any ideas?
the end of 1 category title of next category. can add note cell, , can use getnote()
method note.
google documentation - getnote()
so, can find end of previous section putting note heading of next section, use code check note in cell.
var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheets()[0]; var range = sheet.getrange("a2:a4"); var data = range.getvalues(), thiscell; (var i=0;i<data.length;i+=1) { thiscell = sheet.getrange(i+2, 1); logger.log(thiscell.getnote()); if (thiscell.getnote() === 'end') { sheet.insertrowbefore(i+1); }; }
Comments
Post a Comment