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});

}​

Related Posts:

  • PDF Generation with XSL - FOP Create report in PDF format using XSLFO and Apache FOP XSLFO is XSL Formatting Objects and can be used for formatting XML data.Apache FOP (Formatting Objects Processor) is a Java application that reads a formatting object… Read More
  • Format USB/SD Card HOW TO FORMAT A WRITE PROTECT USB DRIVE? What is Write Protected error and why it happens?This seems to be the problem of most of us these days and some of our readers who wanted to know the methods how they can… Read More
  • XSL - Special Characters (Tab, Line Break, Space ...)&#x9; for tab &#x20; for space &#xa0; for non-breaking space &#xa; line break        m2, cm2 ...  <fo:character character="2" baseline-shift="super" font-size="5pt" /> … Read More
  • SVG - Draw Arrow SVG  Sample 1 <svg xmlns="http://www.w3.org/2000/svg" viewBox="-50 -100 200 200"> <defs> <marker id='mid' orient="auto" markerWidth='2' markerHeight='4' refX='0.1' refY='1'> <!-- tr… Read More
  • Javascript - Script tag in head or bottom of HTML There are two possibilities for truly unobtrusive scripts: including an external script file via a script tag in the head section including an external script file via a script tag at the bottom of the body (before </bod… Read More

0 comments:

Post a Comment