View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pai pai is offline
external usenet poster
 
Posts: 13
Default Does anyone know how I can concat duplicate cells associating info?

On Tuesday, June 24, 2003 12:34:05 AM UTC+5:30, Tom Ogilvy wrote:
Sub Tester3()
Dim lastrow As Long
Dim i As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
i = lastrow
Do While i 1
If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
Cells(i - 1, 2).Value = Cells(i - 1, 2).Value & "; " & _
Cells(i, 2).Value
Cells(i, 1).EntireRow.Delete
End If
i = i - 1
Loop

End Sub

Worked for me with the data you show.

Regards,
Tom Ogilvy

"Amie Fleming" wrote in message
...
Tom,

Thanks for the reply. Sorry I wasn't specific enough...

Here is an example of my data:

ID | Data
--------------------------
1231 web
1242 email
1267 data1
2983 data2
3049 web
3049 email
7869 email
5930 data3
5930 web
5930 data1

The above is my spreadsheet (with a TON of data). I need to search for
ID's which are duplicates (3049 and 5930 in the example), and create
just one row (so that I end up with unique ID's for each row). I need
to concat the "Data" field's data...so my results would be as follows:

ID | Data
--------------------------
1231 web
1242 email
1267 data1
2983 data2
3049 web;email
7869 email
5930 data3;web;data1

If anyone has any tips I would greatly appriciate it!

Thanks!


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


What if don't want to Delete the Duplicate Rows?