Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 18
Default Unique cells in a row

Hi all,

I have a need to select and store unique cell contents in a large number of
rows. I guess I would like a formula that looks something like
=unique(a2:a22,","," ") where the information I would to test is in cells a2
through a22, seperate the contents of the unique cell contents, and ignore
cells containing " ".

supl1 supl2 supl3 supl4 supl5 Unique
order1 aa aa ab cd aa,ab,ac
order2 aa aa aa aa
order3 cd ab ef dd cd,ab,ef,dd

And so on. I expect something like this could be built using VB, but I am
VB challenged. I wonder if there is already such a function or where I might
go to get some help building one?

As always, thanks so much for your help.
--
Bill Wehrmacher
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,268
Default Unique cells in a row

You can use filteradvanced filter, copy to another location and select
unique records only.
If you have Excel 2007 it has a built in functionality called remove
duplicates


--


Regards,


Peo Sjoblom



"Wehrmacher" wrote in message
...
Hi all,

I have a need to select and store unique cell contents in a large number
of
rows. I guess I would like a formula that looks something like
=unique(a2:a22,","," ") where the information I would to test is in cells
a2
through a22, seperate the contents of the unique cell contents, and ignore
cells containing " ".

supl1 supl2 supl3 supl4 supl5 Unique
order1 aa aa ab cd aa,ab,ac
order2 aa aa aa aa
order3 cd ab ef dd cd,ab,ef,dd

And so on. I expect something like this could be built using VB, but I am
VB challenged. I wonder if there is already such a function or where I
might
go to get some help building one?

As always, thanks so much for your help.
--
Bill Wehrmacher



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 18
Default Unique cells in a row

Thanks Peo,

I looked at the advanced filter before writing and couldn't make it do what
I wanted. I will look again. I think the Excel has the nearly same
features, but I don't recall specifically seeing the remove duplicates...

Thanks again
--
Bill Wehrmacher


"Peo Sjoblom" wrote:

You can use filteradvanced filter, copy to another location and select
unique records only.
If you have Excel 2007 it has a built in functionality called remove
duplicates


--


Regards,


Peo Sjoblom



"Wehrmacher" wrote in message
...
Hi all,

I have a need to select and store unique cell contents in a large number
of
rows. I guess I would like a formula that looks something like
=unique(a2:a22,","," ") where the information I would to test is in cells
a2
through a22, seperate the contents of the unique cell contents, and ignore
cells containing " ".

supl1 supl2 supl3 supl4 supl5 Unique
order1 aa aa ab cd aa,ab,ac
order2 aa aa aa aa
order3 cd ab ef dd cd,ab,ef,dd

And so on. I expect something like this could be built using VB, but I am
VB challenged. I wonder if there is already such a function or where I
might
go to get some help building one?

As always, thanks so much for your help.
--
Bill Wehrmacher




  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 18
Default Unique cells in a row

Hi again,

I looked at the advanced filter. It sort of does what I need with a couple
of shortcomings. The first is that it only seems to work to filter columns.
I can deal with that by transposing my spreadsheet, although Excel's 256
columns are insufficient. The second is that I can't find a way to make the
advanced filter filter more than one column at a time. As I have several
thousand rows to analyse, this will be a difficult approach.

Thanks.
--
Bill Wehrmacher


"Wehrmacher" wrote:

Thanks Peo,

I looked at the advanced filter before writing and couldn't make it do what
I wanted. I will look again. I think the Excel has the nearly same
features, but I don't recall specifically seeing the remove duplicates...

Thanks again
--
Bill Wehrmacher


"Peo Sjoblom" wrote:

You can use filteradvanced filter, copy to another location and select
unique records only.
If you have Excel 2007 it has a built in functionality called remove
duplicates


--


Regards,


Peo Sjoblom



"Wehrmacher" wrote in message
...
Hi all,

I have a need to select and store unique cell contents in a large number
of
rows. I guess I would like a formula that looks something like
=unique(a2:a22,","," ") where the information I would to test is in cells
a2
through a22, seperate the contents of the unique cell contents, and ignore
cells containing " ".

supl1 supl2 supl3 supl4 supl5 Unique
order1 aa aa ab cd aa,ab,ac
order2 aa aa aa aa
order3 cd ab ef dd cd,ab,ef,dd

And so on. I expect something like this could be built using VB, but I am
VB challenged. I wonder if there is already such a function or where I
might
go to get some help building one?

As always, thanks so much for your help.
--
Bill Wehrmacher




  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Unique cells in a row

Bill,

Copy the UDF code below into a regular codemodule in your project, then use it like

=Unique(A2:H2)

and copy it down...

HTH,
Bernie
MS Excel MVP

Function Unique(inRange As Range) As String
Dim myC As Range
Unique = ""
For Each myC In inRange
If InStr(1, Unique, " " & myC.Value & ",") = 0 Then
Unique = Unique & " " & myC.Value & ","
End If
Next myC
Unique = Mid(Unique, 2, Len(Unique) - 2)
End Function


"Wehrmacher" wrote in message
...
Hi all,

I have a need to select and store unique cell contents in a large number of
rows. I guess I would like a formula that looks something like
=unique(a2:a22,","," ") where the information I would to test is in cells a2
through a22, seperate the contents of the unique cell contents, and ignore
cells containing " ".

supl1 supl2 supl3 supl4 supl5 Unique
order1 aa aa ab cd aa,ab,ac
order2 aa aa aa aa
order3 cd ab ef dd cd,ab,ef,dd

And so on. I expect something like this could be built using VB, but I am
VB challenged. I wonder if there is already such a function or where I might
go to get some help building one?

As always, thanks so much for your help.
--
Bill Wehrmacher





  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 18
Default Unique cells in a row

Thanks Bernie,

You certainly are an MVP. The code works very well.

I really appreciate it, and so will my boss. ;-)
--
Bill Wehrmacher


"Bernie Deitrick" wrote:

Bill,

Copy the UDF code below into a regular codemodule in your project, then use it like

=Unique(A2:H2)

and copy it down...

HTH,
Bernie
MS Excel MVP

Function Unique(inRange As Range) As String
Dim myC As Range
Unique = ""
For Each myC In inRange
If InStr(1, Unique, " " & myC.Value & ",") = 0 Then
Unique = Unique & " " & myC.Value & ","
End If
Next myC
Unique = Mid(Unique, 2, Len(Unique) - 2)
End Function


"Wehrmacher" wrote in message
...
Hi all,

I have a need to select and store unique cell contents in a large number of
rows. I guess I would like a formula that looks something like
=unique(a2:a22,","," ") where the information I would to test is in cells a2
through a22, seperate the contents of the unique cell contents, and ignore
cells containing " ".

supl1 supl2 supl3 supl4 supl5 Unique
order1 aa aa ab cd aa,ab,ac
order2 aa aa aa aa
order3 cd ab ef dd cd,ab,ef,dd

And so on. I expect something like this could be built using VB, but I am
VB challenged. I wonder if there is already such a function or where I might
go to get some help building one?

As always, thanks so much for your help.
--
Bill Wehrmacher




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
Aggregate Unique part no in cells to sum qty Marty Marshfield Excel Discussion (Misc queries) 4 September 20th 07 02:06 AM
Restricting cells to unique values Todd Excel Discussion (Misc queries) 2 February 2nd 07 05:45 AM
Counting only Unique cells Bob Excel Worksheet Functions 11 June 9th 06 06:19 PM
count cells with unique numbers Alex Excel Worksheet Functions 1 February 21st 05 07:46 PM
in excel - i have a row of cells i need to make 'unique' and do n. gtoffice Excel Worksheet Functions 1 January 13th 05 06:54 PM


All times are GMT +1. The time now is 10:57 PM.

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"