Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 107
Default Make list of cells in array and checking for duplicates

I have an array B2:F11, that has text in each cell. I need to make a
concantenated list in H2 where cell values are separated by commas. I also
need to make sure that the values in the compiled list are all unique,
because there is a chance that the same value will exist in more than one
cell.

The last thing I need to do is make sure the compiled list is in descending
order.

Can anyone help?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Make list of cells in array and checking for duplicates

Hi Jenna:

Try this little macro as a start:

Sub jena()
Set r1 = Range("B2:F11")
Set r2 = Range("Z1")
j = 0
For Each r In r1
r2.Offset(j, 0).Value = r.Value
j = j + 1
Next
Range("Z1:Z50").Sort Key1:=Range("Z1"), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

For i = 50 To 2 Step -1
If Cells(i, "Z").Value = Cells(i - 1, "Z").Value Then
Cells(i, "Z").Delete Shift:=xlUp
End If
Next

v = ""
n = Cells(Rows.Count, "Z").End(xlUp).Row
For i = 1 To n
v = v & Cells(i, "Z").Value & ","
Next

Range("H2").Value = v
End Sub

It uses Z1 thru Z50 as helper cells to simplify the sort.
--
Gary''s Student - gsnu200771


"Jenn" wrote:

I have an array B2:F11, that has text in each cell. I need to make a
concantenated list in H2 where cell values are separated by commas. I also
need to make sure that the values in the compiled list are all unique,
because there is a chance that the same value will exist in more than one
cell.

The last thing I need to do is make sure the compiled list is in descending
order.

Can anyone help?

Thanks!

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
checking for duplicates Ted Metro Excel Worksheet Functions 1 April 3rd 07 05:42 PM
Array Formulas - Unique List from List with Duplicates Johnny Meredith Excel Discussion (Misc queries) 7 October 27th 06 09:26 PM
Error Checking for Duplicates in List bman342 Excel Worksheet Functions 2 June 29th 06 11:15 AM
Checking for duplicates - think this is simple [email protected] Excel Discussion (Misc queries) 9 February 27th 06 09:32 PM
Make a list that excludes duplicates Phil Osman Excel Discussion (Misc queries) 5 June 17th 05 05:08 AM


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