Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
sandy_eggo
 
Posts: n/a
Default Find Duplicates & Concatenate (cpm)

Hi there,

I'm usually pretty good with excel but I have a file that looks like:

-A- -H-
AMW1 130065
AMW1 130062
AMW1 130063
AMW1 130066
AMW1 130067
AMW1 130110
AMW1 210038
AMW1 2100621
AMW1 2100622
AMW1 130065
AMW1 210063
AMW1 210065
AMW1 210110
AMW1 220038
AMW1 220062
AMW1 210067
AMW1 220063
AMW1 220066
AMW1 220110
AP1 110109, 130109, 190109, 240109
AP1 130018, 230018
AP1 130019, 190019
AP1 130033, 190033
AP1 130034, 240034
AP1 130035
AP1 130041
AP1 130102, 190102
AP1 130103, 180103, 190103
AP1 130107, 190107
AP1 130108, 200108
AP1 130110, 150110, 210110, 220110
AP1 130111, 180111, 1901111, 1901112
AP1 130114, 190114, 200114
AP1 130116, 190116
AP1 130118, 190118
AP1 130147, 200147
AP1 130148
AP1 190021
AP1 190036

That I want to turn into:

-A- -I-
AMW1 #, #, #, #, #, #, #, #, .....
AP1 #, #, #, #, #, #, #, #, .....

Where the first column (A) has several lines of repeating names (could
repeat 1X, 11X, 20X, 40X) that I have to concatenate the corresponding
value (H) with the second column (I). Make sense?

I'd appreciate any help. It's a HUGE 179,398 line xls--that I'd really
rather not convert by hand.

  #2   Report Post  
Marcus Langell
 
Posts: n/a
Default

I would run a macro that lookes something like this:
(Please note that I haven't looked it through thoroughly. There might be
errors or things that could have been done in a better way. But it worked
when I tested it on your material.)

Sub conc()
Dim a, b As Integer
Dim c, d As String
a = 2
b = 2
c = ""
d = Range("A2")
While Range("A" & a) < ""
While Range("A" & a) = d
c = c & Range("B" & a)
a = a + 1
If Range("A" & a) = d Then c = c & ", "
Wend
Range("C" & b) = d
Range("D" & b) = c
d = Range("A" & a)
b = b + 1
c = ""
Wend
End Sub


/Marcus


"sandy_eggo" wrote:

Hi there,

I'm usually pretty good with excel but I have a file that looks like:

-A- -H-
AMW1 130065
AMW1 130062
AMW1 130063
AMW1 130066
AMW1 130067
AMW1 130110
AMW1 210038
AMW1 2100621
AMW1 2100622
AMW1 130065
AMW1 210063
AMW1 210065
AMW1 210110
AMW1 220038
AMW1 220062
AMW1 210067
AMW1 220063
AMW1 220066
AMW1 220110
AP1 110109, 130109, 190109, 240109
AP1 130018, 230018
AP1 130019, 190019
AP1 130033, 190033
AP1 130034, 240034
AP1 130035
AP1 130041
AP1 130102, 190102
AP1 130103, 180103, 190103
AP1 130107, 190107
AP1 130108, 200108
AP1 130110, 150110, 210110, 220110
AP1 130111, 180111, 1901111, 1901112
AP1 130114, 190114, 200114
AP1 130116, 190116
AP1 130118, 190118
AP1 130147, 200147
AP1 130148
AP1 190021
AP1 190036

That I want to turn into:

-A- -I-
AMW1 #, #, #, #, #, #, #, #, .....
AP1 #, #, #, #, #, #, #, #, .....

Where the first column (A) has several lines of repeating names (could
repeat 1X, 11X, 20X, 40X) that I have to concatenate the corresponding
value (H) with the second column (I). Make sense?

I'd appreciate any help. It's a HUGE 179,398 line xls--that I'd really
rather not convert by hand.


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
Find duplicate rows then deleting them SSHO_99 Excel Worksheet Functions 4 May 4th 07 11:17 AM
Find and mark duplicates maxtrixx Excel Discussion (Misc queries) 3 May 6th 05 02:13 AM
How do I find only the singular rows in a sheet with duplicates? Alli Excel Discussion (Misc queries) 2 May 4th 05 04:21 PM
How do I find duplicates in a list JimNC Excel Discussion (Misc queries) 1 February 6th 05 08:40 PM
Find duplicates R. Choate Excel Discussion (Misc queries) 5 November 28th 04 10:14 PM


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