Results 1 to 2 of 2
  1. #1
    boy's Avatar
    Join Date
    Mar 2014
    Gender
    female
    Location
    MEGAN ft $NOT
    Posts
    3,072
    Reputation
    1078
    Thanks
    737
    My Mood
    Scared

    Help me w my broken java script

    It's supposed to look for change in the Sheet "RAW" and then create a row on top of Sheet "Raw" and "Examples" with some functions applied to

    it also creates a new row when an edit is found in Examples, I'm trying to figure out onChange range notation as well

    Code:
    function createSpreadsheetOpenTrigger(e) {
        if (!e) {
            throw new Error('Script now running');
        }
        if (e.range.getA1Notation() !== 'A2') {
            return;
        }
        var ss = SpreadsheetApp.getActive();
        ScriptApp.newTrigger('myFunction')
            .forSpreadsheet(ss)
            .onOpen()
            .create();
    }
    sh.insertRowAfter(1);
    sh.setRowHeight(2, 21);
    var freeze = sh.getRange("A2:C2");
    freeze.copyTo(freeze, {
        contentsOnly: false
    });
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sh = ss.getSheetByName("Examples");
    sh.insertRowAfter(1);
    sh.setRowHeight(2, 21);
    sh.getRange("A2").setFormula('=RAW!A3');
    sh.getRange("B2").setFormula('=(RAW!K3)');
    sh.getRange("C2").setFormula('=IFERROR(IFS(RAW!L3="P", "Put", RAW!L3="C", "Covered Call"),"")');
    sh.getRange("D2").setFormula('=IFS(RAW!P3>0,RAW!P3, RAW!O3>0,RAW!O3)');
    sh.getRange("E2").setFormula('=RAW!D3');
    sh.getRange("F2").setFormula('=RAW!E3');
    sh.getRange("G2").setFormula('=RAW!F3');
    sh.getRange("H2").setFormula('=IFERROR(IF(AND(C3<>"Stock",E3<0),E3*0.65-0.05,""),"")');
    sh.getRange("I2").setFormula('=IF(AND(J3<>TRUE,E3<>0),F3-G3--H3,"")');
    sh.getRange("M2").setFormula('=IFERROR(IF(ISBLANK(B3),,IF(AND(C3="Put",E3=-1),D3*100*E3*-1,"")),"")');
    sh.getRange("O2").setFormula('=IFS(ISBLANK(A3),,DATEDIF(A3,RAW!U3,"D"),"")');

  2. #2
    boy's Avatar
    Join Date
    Mar 2014
    Gender
    female
    Location
    MEGAN ft $NOT
    Posts
    3,072
    Reputation
    1078
    Thanks
    737
    My Mood
    Scared
    nvm i fixed it

Similar Threads

  1. [WTB] Buying Help with AP Comp Sci assignments (Java Script)
    By manny000 in forum Buying Accounts/Keys/Items
    Replies: 1
    Last Post: 01-10-2017, 12:02 PM
  2. [Help] Need help with Java Script Combo Box
    By money001 in forum Web Languages
    Replies: 1
    Last Post: 01-24-2012, 11:02 PM
  3. [Help Request] Java Script Read Timed out, Clock Spam, Unable to Connect to minecraft.exe
    By [=Evl=] in forum Minecraft Help
    Replies: 16
    Last Post: 01-24-2012, 10:08 PM
  4. Replies: 1
    Last Post: 07-05-2006, 07:20 AM
  5. OMG I SO STUCK!!!(Java Script "n" html problem
    By jeremywilms in forum Programming
    Replies: 11
    Last Post: 06-15-2006, 02:23 PM