88 */
99function run ( ) {
1010 const sheet = SpreadsheetApp . getActiveSheet ( ) ;
11- const base = sheet . getRange ( 'C3:C ' ) ;
11+ const base = sheet . getRange ( 'I3:I ' ) ;
1212 const colFormula = sheet . getRange ( 'J3' ) ;
1313 draggDownFormulas_ ( base , colFormula ) ;
1414}
1515
16+ function runBulk ( ) {
17+ const formulasCells = [ 'J3' , 'K3' , 'M3' ] ;
18+ const sheet = SpreadsheetApp . getActiveSheet ( ) ;
19+ const base = sheet . getRange ( 'I3:I' ) ;
20+ formulasCells . forEach ( ( cell ) => {
21+ const colFormula = sheet . getRange ( cell ) ;
22+ draggDownFormulas_ ( base , colFormula ) ;
23+ } ) ;
24+ }
25+
1626/**
1727 * User action. Runs the snippet
1828 */
@@ -30,7 +40,7 @@ function run2() {
3040function draggDownFormulas_ ( base , colFormula ) {
3141 const baseValues = base . getValues ( ) ;
3242 const lastBase =
33- baseValues . length - baseValues . reverse ( ) . findIndex ( row => row [ 0 ] !== '' ) ;
43+ baseValues . length - baseValues . reverse ( ) . findIndex ( ( row ) => row [ 0 ] !== '' ) ;
3444 const colFormulaFormula = colFormula . getFormula ( ) ;
3545 colFormula
3646 . getSheet ( )
@@ -50,7 +60,7 @@ function draggDownFormulas_(base, colFormula) {
5060function draggDownOneFormula_ ( base , colFormula ) {
5161 const baseValues = base . getValues ( ) ;
5262 const lastBase =
53- baseValues . length - baseValues . reverse ( ) . findIndex ( row => row [ 0 ] !== '' ) ;
63+ baseValues . length - baseValues . reverse ( ) . findIndex ( ( row ) => row [ 0 ] !== '' ) ;
5464 const colFormulaFormula = colFormula . getFormula ( ) ;
5565 colFormula
5666 . getSheet ( )
0 commit comments