Retrieving Multiple Range Selection in Spreadsheet (GAS)

Asked 2 years ago, Updated 2 years ago, 100 views

In Spreadsheets Add-on (Google Apps Script),

vars=SpreadsheetApp.getActiveSheet();
range=ss.getActiveRange();
var values = range.getValues();

Then, if the selection range is selected in Ctrl or Command over multiple areas, such as images,

 value: [[a11, b11, c11], [a12, b12, c12], [a13, b13, c13], [a14, b14, c14]]

returns (only the last selected part returns values)

I would like to get the range that I originally selected as range, but is there any way?

Multi-range selection

google-apps-script google-spreadsheet

2022-09-30 16:14

1 Answers

getActiveRange() allows you to retrieve only a few cells if you select multiple ranges in Ctrl.
There seems to be some requests, but they are not available at this time.

Add support to allow use and manual disjoint Ranges
https://issuetracker.google.com/issues/36761866


2022-09-30 16:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.