Answer the question
In order to leave comments, you need to log in
How to get data from a non-continuous range selected via Ctrl?
I select the range through Ctrl:
And there is a code:
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet()
var val = ss.getActiveRange().getValues()
Logger.log(val)
}
Information
Answer the question
In order to leave comments, you need to log in
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet()
var arr = ss.getActiveRangeList().getRanges()
var val = []
for(let i = 0; i<arr.length;i++){
val.push(arr[i].getValues())
}
Logger.log(val)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question