Remove duplicate values in rows and cells

aequitas1903

Board Regular
Joined
Mar 8, 2012
Messages
127
Hello everyone,

Is it possible to gather a list of unique items from a selected area like 50rows x 50columns ?
As far as I know, removing duplicates from excel includes columns only. But I do have a data which is 50x50 cells and have to see all unique items at once. Otherwise I have to do it for each column seperately, combine them and remove duplicates for last time. (which I already did ;) but I wonder if it was possible)

Example :
1
3
1
7
3
4
9
5
2
8
4
3
6

<tbody>
</tbody>
The outcome should be in a column like
1
3
5.... (the sorting is not important :) )

It could be a vba code or a formula. But a formula will be better for understanding the process.

Your help is always appreciated.
Regards
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Code:
Sub duplicateRemove()
lr = ActiveSheet.UsedRange.Rows.Count
lc = ActiveSheet.UsedRange.Columns.Count
Cells(1, lc).Select
drow = lr + 1
For c = 2 To lc
  Range(Cells(1, c), Cells(lr, c)).Cut Cells(drow, 1)
  drow = drow + lr
  Application.CutCopyMode = False
Next
ActiveSheet.UsedRange.RemoveDuplicates Columns:=1, Header:=xlNo
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,074
Messages
6,128,654
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top