LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default extracting unique items

Hi I received this great response to an earlier post that I have made
concerning the following sweep:
http://www.standardsbigbid.com/londo...Help.php#works,
...and would need the kind of illustration, a pretty much excel novice person
like myself, would need. Thanks for your (listening) time :-
-----Original Message-----

Hi, the following macro will extract unique values. The
input range is Rng1 and the output range is Rng2.

Sub ListUniqueVal()

Dim Rng1 As Range
Dim Rng2 As Range
Dim Cell As Range
Dim UniqueValues As New Collection

Set Rng1 = Range("B4:C10")
Set Rng2 = Range("E4")
On Error Resume Next
For Each Cell In Rng1
UniqueValues.Add Cell.Value, CStr(Cell.Value)
Next Cell

For Each Item In UniqueValues
Rng2.Value = Item
Set Rng2 = Rng2.Offset(1, 0)
Next Item

End Sub


John Mansfield
pdbook.com


 
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
Extracting unique entries Gaurav[_2_] Excel Worksheet Functions 6 November 14th 07 01:43 PM
extracting unique records [email protected] Excel Discussion (Misc queries) 1 September 6th 07 07:55 AM
subtracting (extracting non-duplicate items)HELP!! rtek Excel Worksheet Functions 2 May 16th 06 01:24 PM
extracting unique rows DANmcc New Users to Excel 1 April 20th 05 01:42 AM
Adding Items to a ListBox-Unique Items Only jpendegraft[_14_] Excel Programming 2 May 2nd 04 02:27 AM


All times are GMT +1. The time now is 09:42 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"