Google Sheets script for selecting multiple values to populate a cell
Code forked from coinsandsteeldev/dialog.html, adapted from https://www.youtube.com/watch?v=dm4z9l26O0I (value separator changed from , to ;)
Instructions adapted from https://stackoverflow.com/questions/23369296/selecting-multiple-values-from-a-dropdown-list-in-google-spreadsheet/53310932#53310932
To use this script:
- In your Google Sheet, set up data validation for a cell (or cells), using data from a range. In cell validation, do not select 'Reject input'.
- Go to Extensions > Apps Script
- In the script editor, go to Files > + > Script
- Name the file multi-select.gs and paste in the contents of multi-select.gs. Save.
- In the script editor, go to Files > + > HTML
- Name the file dialog.html and paste in the contents of dialog.html. Save.
- Run multi-select.gs a. Review permissions b. Sign in c. Allow
- Back in your spreadsheet, you should now have a new menu called 'Scripts'. Refresh the page if necessary.
- Select the cell you want to fill with multiple items from your validation range.
- Go to Scripts > Multi-select for this cell... and the sidebar should open, showing a checklist of valid items.
- Tick the items you want and click the 'Set' button to fill your cell with those selected items, comma [semicolon] separated. You can leave the script sidebar open. When you select any cell that has validation, click 'Refresh validation' in the script sidebar to bring up that cell's checklist.
Notes • This is a container-bound script (bound by the sheet in which it was created) • Only users who have permission to edit a container can run its bound script.