Posts

Showing posts from November, 2022

Copy Paste Data, Remove Filter, Apply Filter, Delete Filtered Data

Copy Paste Data, Remove Filter, Apply Filter, Delete Filtered Data function   UpdateRationDistributionData (){    const   ss = SpreadsheetApp . getActiveSpreadsheet ();    const   sh1 = ss . getSheetByName ( 'Form Responses 1' );    const   lastRow1 = sh1 . getDataRange (). getLastRow ()- 1 ;    const   sh2 = ss . getSheetByName ( 'Ration Distribution Raw Data' );    const   lastRow2 = sh1 . getDataRange (). getLastRow ()- 1 ;    sh2 . getRange ( 'A1' ). setValue ( 'Member ID' );    sh2 . getRange ( 2 , 1 , lastRow2 ). setFormulaR1C1 ( '="M-" & LEFT(RC[32],4) &"-" & "Ration" & "-" & REPT(0,5-LEN(ROW()-1)) & ROW()-1' );    const   lastRow3 = sh2 . getDataRange (). getLastRow ();    sh2 . getRange ( 'A1:A' + lastRow3 ). copyTo ( sh2 . getRange ( 'A1' ), ...

Copy and Paste Data Range

Copy and Paste Data Range function   CopyToFunction () {    const   ss = SpreadsheetApp . getActiveSpreadsheet ();    const   sh = ss . getSheets ()[ 0 ];    //sh.getRange('A1:C5').copyTo(sh.getRange('E1'), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);    sh . getRange ( 'A1:C5' ). copyTo ( sh . getRange ( 'E1' ),  SpreadsheetApp . CopyPasteType . PASTE_NORMAL ,  false );    //sh.getRange('A1:C5').copyTo(sh.getRange('E1'), SpreadsheetApp.CopyPasteType.PASTE_FORMULA, false);    //SpreadsheetApp.CopyPasteType.PASTE_NORMAL }