Concatenate Worksheets in Google Spreadsheet to new worksheet -


i have google spreadsheet contains multiple worksheets. worksheets have same columns have additional columns. concatenate worksheets single, newly created worksheet in same workbook. differences in columns should contain blank values.

bonus points if adapted use on multiple workbooks. preferable if select sheets concatenate.

i have tried write script struggling.

the mother of sheets

you of spreadsheets in drive , of them well. i'm not doing it. allows include sheets want concatenated adding them array includedsheet.

function concatallsheets() {   var includedsheet=['sheet1','sheet2','sheet3'];   var ss=spreadsheetapp.getactive();   var allsheets=ss.getsheets();   var sheetname='motherofallsheets-' + utilities.formatdate(new date(), session.getscripttimezone(), "yyyymmddhhmm")   var mother=ss.insertsheet(sheetname);   for(var i=0;i<allsheets.length;i++)   {     var sht=allsheets[i];     if(includedsheet.indexof(sht.getname())>-1)     {       var rng=sht.getdatarange();       var rnga=rng.getvalues();       for(var j=0;j<rnga.length;j++)       {         var row=rnga[j];         mother.appendrow(row);       }     }   } } 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -