The .uniqueValues() method of cDataColumn will return a collection of cells - one for each unique value in the column. This is a really simple way of creating a look up table from a set of data. Here's how to extract the unique values from one sheet and create a column of them in another
Google Apps Script
As per all examples on this site, I use caching for Google Apps Script.
Having populated the DataSet that represents the contents of the sheet 'Sankey', each unique value in the "sourceLabel" column is copied to a column in the "messAround" sheet, after giving the column a title.
,uniqueValues() takes an optional argument that selects the kind of sorting required as below. By default the list is presented in the order encountered.
You want to learn Google Apps Script?
Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, available All formats are available now from O'Reilly,Amazon and all good bookshops. You can also read a preview on O'Reilly.
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Get Started Snippets > One Liners >