getActiveRange not returning current selection

后端 未结 3 677
情歌与酒
情歌与酒 2021-01-24 17:51

This should be a simple one, but I could not crack it myself... I want to copy the currently selected cells in the active sheet in an array called data:

var shee         


        
3条回答
  •  盖世英雄少女心
    2021-01-24 18:43

    This gets and displays the active range in a dialog window.

    function getARange(){
      var ss=SpreadsheetApp.getActive();
      var sh=ss.getActiveSheet();
      var rg=sh.getActiveRange();
      var vA=rg.getValues();
      var s='';
      for(var i=0;i%s', vA[i].join(','));
      }
      var userInterface=HtmlService.createHtmlOutput(s);
      SpreadsheetApp.getUi().showModelessDialog(userInterface, 'The Active Range')
    }
    

提交回复
热议问题