Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding Unique Values from Multiple Columns

I have a worksheet with 3 columns and there are duplicate records under
all 3 columns. Here's a sample of data


Col A Col B Col C
1| John Red 15 <--- dup with 3rd row
2| John Blue 18
3| John Red 15 <--- dup with 1st row
4| John Green 20
5| Smith Blue 20 <--- dup with 7th row
6| Smith Red 15
7| Smith Blue 20 <--- dup with 5th row

I am trying write a module of VBA code so that when the user clicks a
button it will find all the unique "combination", and display the
following on a separate worksheet.

John Red 15
John Blue 18
John Green 20
Smith Blue 20
Smith Red 15
Smith Blue 20

I wish I don't have to use advanced filter manually because the
worksheet holds 5000+ records.

Thanks in advance for all the help and ideas.

Andrew



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Finding Unique Values from Multiple Columns

I wish I don't have to use advanced filter manually because the
worksheet holds 5000+ records.


You can do it with VBA like this


Sub testing()
Sheets("sheet1").Range("A:C").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Sheets("Sheet2").Range("A1"), _
CriteriaRange:="", Unique:=True
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Disco" wrote in message ...
I have a worksheet with 3 columns and there are duplicate records under
all 3 columns. Here's a sample of data


Col A Col B Col C
1| John Red 15 <--- dup with 3rd row
2| John Blue 18
3| John Red 15 <--- dup with 1st row
4| John Green 20
5| Smith Blue 20 <--- dup with 7th row
6| Smith Red 15
7| Smith Blue 20 <--- dup with 5th row

I am trying write a module of VBA code so that when the user clicks a
button it will find all the unique "combination", and display the
following on a separate worksheet.

John Red 15
John Blue 18
John Green 20
Smith Blue 20
Smith Red 15
Smith Blue 20

I wish I don't have to use advanced filter manually because the
worksheet holds 5000+ records.

Thanks in advance for all the help and ideas.

Andrew



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
finding unique values waylonk Excel Discussion (Misc queries) 2 May 3rd 10 09:40 PM
Count unique values across two columns with multiple conditions Ert Excel Worksheet Functions 4 March 8th 09 12:22 AM
Filter for unique values in multiple columns sahafi Excel Discussion (Misc queries) 6 October 24th 08 09:05 PM
List Unique Values from multiple columns Chance224 Excel Discussion (Misc queries) 0 June 19th 08 08:06 PM
Finding Unique Values in Column Kirk P. Excel Discussion (Misc queries) 1 January 25th 05 02:01 PM


All times are GMT +1. The time now is 02:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"