I'm trying to delete all duplicate values from a column of numbers in Excel. I want the remaining column to only contain unique values from the original table.
I have tried using the RemoveDuplicates method but it only removes a single instance of a duplicate instead of all of them.
I have also tried using the following code but it has the same problem as RemoveDuplicates. I'm not sure why though since the "Unique" tag is set to "True".
{MYWORKSHEET]AdvancedFilter Action:= _
xlFilterCopy, CopyToRange:=[MYWORKSHEET].Range("B1"), Unique:=True
I have only found one solution that should work theoretically that uses a nested For loop to iterate over every individual row and check if it is equivalent to any other row in the table. The only problem is that this crashes Excel on my machine because it has to loop so much. Is there any way to do this other than this brute force method?
Here is what I'm looking for:
|-------| |----------------| |-------------------|
| INPUT | | DESIRED OUTPUT | | WHAT I DONT WANT |
|-------| |----------------| |-------------------|
| 11111 | | 11111 | | 11111 |
|-------| |----------------| |-------------------|
| 22222 | | 55555 | | 22222 |
|-------| |----------------| |-------------------|
| 33333 | | 33333 |
|-------| |-------------------|
| 22222 | | 55555 |
|-------| |-------------------|
| 33333 |
|-------|
| 55555 |
|-------|


