Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default delete duplicate then combine text

I have thoes text in A1:A5 and now want to have that string in A6 , pleas any
help

ColumnA
1 book
2 pencil
3 pen
4 pen
5 book
6 book,pencil,pen

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default delete duplicate then combine text

Just concatenate each cell value, excluding the duplicate, in cell A6
=A1&", "&A2&", "&A3&", "&A5
--
Kevin Backmann


"gr_jafari" wrote:

I have thoes text in A1:A5 and now want to have that string in A6 , pleas any
help

ColumnA
1 book
2 pencil
3 pen
4 pen
5 book
6 book,pencil,pen

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default delete duplicate then combine text

Dear Kevin B , many thanks for answer , but i want to do that with a function
that operats automatically and flexible.

"Kevin B" wrote:
Just concatenate each cell value, excluding the duplicate, in cell A6
=A1&", "&A2&", "&A3&", "&A5
--
Kevin Backmann


"gr_jafari" wrote:

I have thoes text in A1:A5 and now want to have that string in A6 , pleas any
help

ColumnA
1 book
2 pencil
3 pen
4 pen
5 book
6 book,pencil,pen

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default delete duplicate then combine text

in other word , i need a function that selects uniqe records of a long list
and combine them with a comma seprator in a cell

gr_jafari



"gr_jafari" wrote:

Dear Kevin B , many thanks for answer , but i want to do that with a function
that operats automatically and flexible.

"Kevin B" wrote:
Just concatenate each cell value, excluding the duplicate, in cell A6
=A1&", "&A2&", "&A3&", "&A5
--
Kevin Backmann


"gr_jafari" wrote:

I have thoes text in A1:A5 and now want to have that string in A6 , pleas any
help

ColumnA
1 book
2 pencil
3 pen
4 pen
5 book
6 book,pencil,pen

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default delete duplicate then combine text

Hi,

Here is a macro that does what you want:

Sub UniquesConcatenated()
Dim I As Integer
Dim cell As Range
Dim myAdd As String
Dim myCon As String

myAdd = ActiveCell.End(xlDown).Address
Selection.AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=Range("D1"), _
Unique:=True
I = 1
Range([D1], [D1].End(xlDown)).Select
For Each cell In Selection
If I = 2 Then
myCon = cell
ElseIf I 2 Then
myCon = myCon & "," & cell
End If
I = I + 1
Next cell
Range(myAdd) = myCon
Selection.Clear
End Sub

As written it puts out a unique list into column D, so that range should be
empty or you should change the range in the macro. Also a title is required
as the first cell at the top of your data. And finally you must select the
data with the title before your run the macro.
--
Thanks,
Shane Devenshire


"gr_jafari" wrote:

I have thoes text in A1:A5 and now want to have that string in A6 , pleas any
help

ColumnA
1 book
2 pencil
3 pen
4 pen
5 book
6 book,pencil,pen

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
How do I combine two Excel Workbooks and delete the duplicate colu Myles Excel Discussion (Misc queries) 3 July 19th 07 09:08 PM
How do you delete duplicate addresses, but keep duplicate names? Shelly Excel Discussion (Misc queries) 1 August 28th 06 10:36 PM
How to combine Excel 2002 files and remove duplicate records? Dave542 New Users to Excel 4 April 6th 06 01:08 PM
How do i combine duplicate column headings Mike Excel Worksheet Functions 1 February 1st 06 08:29 AM
Can I compare 2 lists to combine duplicate entries in new list? Tinytall Excel Worksheet Functions 0 May 13th 05 04:00 PM


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