Matt Bartlett
Matt Bartlett

Reputation: 360

Finding out all unique names in a Excel column

I have 2 worksheets that stores information about a weeks transactions. One is this week and the other is last weeks for comparison purposes. The layout is the same for both companies. There will sometimes be companies that had transactions last week but have not made one this week.

The company names appear in one column but can appear multiple times.

When I use the Excel Auto filter function it shows just the unique entries in that column and I would like to replicate that in VBA code so that I can output each company name that appears in either sheet.

I am looking for something similar to Excel - All unique words in a range But in that solution the entries in the cells themselves are split up and I want the cell put in as a whole and compared.

Would it be simple as removing the JOIN code and changing varValues = Split(strAllValues, " ") to have the strAllValues to be the sheet range?

Any questions feel free to ask.

Matt

Upvotes: 0

Views: 80

Answers (1)

neuralgroove
neuralgroove

Reputation: 580

Keep the JOIN, but instead of using a space (" ") for the join use a pipe "|" and then again use a pipe for the split function, that will give you an array of all your individual names

Upvotes: 2

Related Questions