Wednesday, September 13, 2023

Google sheet scripts

 

Duplicate inactive sheet and Rename based in active cell data

function EXPORT() {

    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sti = ss.getSheetByName('Template');
    var sta = ss.getSheetByName('Booking Confirmation');
    var ti = sta.getRange('C7').getValue();

    sti.copyTo(ss).setName(ti);

    var stc = ss.getSheetByName(ti);
    var source = sta.getRange('A5:C23');
    var dest = stc.getRange('A5:C23');

    source.copyTo (dest, {contentsOnly: true});

}​

0 comments:

Post a Comment