Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Script for Spreadsheet - how can I prompt the user to select a range?

I've been doing a lot of work with Google Script to automate some peer evaluation processes.

One result is a spreadsheet with a lot of review data that I need to sort, group and summarize. The script is working fine for the hard-coded sort column.

But I really want to be able to sort on different columns at different times, and I'd like the sort/group/summarize script to prompt the user to select the sort/group column at runtime.

I've explored the UI stuff a bit, but I haven't seen how to prompt the user to select a range (or column or anything else) on the sheet.

Thanks in advance.

like image 421
user2782208 Avatar asked Sep 15 '13 23:09

user2782208


People also ask

How do you select a range of cells in Google Sheets?

To highlight a range, click and hold down on a cell and drag the mouse or trackpad to select the desired range and release the mouse.


1 Answers

I know you are not supposed to post links as answers, but sometimes it just makes sense.

This answer gives a complete solution that I have not tested.

https://stackoverflow.com/a/45427670/188963

This post also describes something similar.

https://medium.com/@piyush.goel/how-to-build-a-range-picker-in-google-apps-script-to-populate-a-text-field-in-the-sidebar-in-google-6bbd4f80d4d2

like image 94
abalter Avatar answered Oct 12 '22 12:10

abalter