Google Sheets – How to Select Multiple Non-Consecutive Cells

google sheetsgoogle-apps-scriptgoogle-sheets-addons

I have a very long, comma-separated list of cell address coordinates, shortened here for the sake of brevity: C3,C7,C17,C56.

I would like to select these cells. Is this possible to do by pasting the values into a field somewhere?

If not, then via a script or add-on?

EDIT:
Considering my intention was to format the cells, this worked for me: Format (menu) > Conditional Formatting Apply conditional formatting rules It would still be useful to know how to select cells, so I'll leave the question here.

Best Answer

Short answer

At this time it's not possible to programmatically select multiple cells.

Remarks

The conditional formatting rule allowing to set several ranges separated by commas is an oddity of Google Sheets as other features like Named Ranges, Range Protection, doesn't allow this and Google Apps Script doesn't have a class for disjoint ranges. Anyway some, tasks could be done by looping through a list of references.

References