loop - problem

30 views
Skip to first unread message

ER

unread,
Sep 28, 2022, 11:22:59 AMSep 28
to Google Apps Script Community
Hi
I want to get the max(V1:V3) in cells: o1 o6 o11 o17...
I try this script:
function _tst() {
  var start = "spreadsheet.getRange('O" ;
  var end  = "').activate();"  ;
 var spreadsheet = SpreadsheetApp.getActive();
  for (var i = 1; i <= 200; i=i+5) 
  {
  start + i + end  
    spreadsheet.getCurrentCell().setFormula('=max(V1:V3)');
  }
}

TNX

Laurie J. Nason

unread,
Sep 29, 2022, 12:27:37 AMSep 29
to Google Apps Script Community

Can you post an example? It seems that you can probably use a helper column to pull out your values every 5 cells into, then do your max there (without any scripting at all). But I am not really understanding how your max of V1:V3 is linked to cells O1,O6 etc?
Laurie


------ Original Message ------
From "ER" <erans...@gmail.com>
To "Google Apps Script Community" <google-apps-sc...@googlegroups.com>
Date 28/09/2022 18:22:59
Subject [Apps-Script] loop - problem

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a30b852e-3e4a-456a-915f-f07cbf190ef9n%40googlegroups.com.

ER

unread,
Sep 29, 2022, 11:23:07 PMSep 29
to Google Apps Script Community
I need a loop that going to cells o1 o6 o11 o16...o106 and put there a formula.
Reply all
Reply to author
Forward
0 new messages