Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Return unique values from 2 different ranges

I have 3 different ranges, say Col C, F and G, that contain duplicate text
entries. How can I make a worksheet list of the unique entries?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Return unique values from 2 different ranges

Not a lot to go on here. Some dupes in the three columns? Dupes in each
column, but not in other columns? It can get a lot more complex too. You
can start with this and see if it does what you need:

Notice: before trying the code...Backup!! Backup!! Backup!!

Sub Uniques()
Dim i As Integer
i = 1
Do Until Cells(i, 1).Value = "" '(as long as your data is in column 1)
If Cells(i, 1) = Cells(i + 1, 1) Then
Else
Cells(i, 1).Copy
Cells(i, 5).PasteSpecial xlValues '(this pastes into column E)
End If
i = i + 1

Loop
Range("E5:E1000").Sort Key1:=Range("E5"), Order1:=xlAscending

Columns("E:E").Select
Selection.Sort Key1:=Range("E1"), Order1:=xlAscending ',
Header:=xlGuess, _

Range("A1").Select

End Sub

Sub ExtractUniqueAndSort()
With Sheets("Unique List#1")
..Range("A1:A20").AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=.Range("E1"), _
Unique:=True

..Range(.Range("E1"), .Range("E1").End(xlDown)) _
..Sort Key1:=.Range("E2"), Order1:=xlAscending, Header:=xlYes
End With
End Sub

I am assuming that all data is in Column A, so change the macro accordingly,
or copy/paste your data into column A.

Good luck,
Ryan---


"John" wrote:

I have 3 different ranges, say Col C, F and G, that contain duplicate text
entries. How can I make a worksheet list of the unique entries?



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
Can COUNTIFS be utilized to return unique values? ascottbag-hcm Excel Worksheet Functions 1 October 27th 09 09:28 PM
Vlookup & return multiple unique values nikko Excel Worksheet Functions 14 May 5th 09 07:02 AM
How to return unique values only nikko Excel Worksheet Functions 4 May 5th 09 04:06 AM
Return Unique Consecutive Duplicate Values across Single Row Sam via OfficeKB.com Excel Worksheet Functions 22 February 6th 07 11:44 AM
Return Unique Duplicate Numeric Values across Single Row Sam via OfficeKB.com Excel Worksheet Functions 7 January 21st 07 02:51 AM


All times are GMT +1. The time now is 08:03 AM.

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

About Us

"It's about Microsoft Excel"