Combine Data into one row

MitzDriver

Board Regular
Joined
Aug 23, 2010
Messages
60
I have a data base with 9000 records. Unfortunately there are duplicate records. Easy enough to remove dup's but.....column a = first name b = last name c = company name d= SubCategory1 and e = SerialNumber (which relates to last name). The problem is column d. I need to combine SubCategory1 with all the other SubCategory1’s for the last name or SerialNumber and then remove the extra rows.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
i.e. instead of three (some times just two and at times four) records:<o:p></o:p>
<o:p></o:p>
John,Smith,University,Hospital,94421<o:p></o:p>
John,Smith,University,GraduateSchool,94421<o:p></o:p>
John,Smith,University,(All),94421<o:p></o:p>
<o:p></o:p>

I will end up with ONLY one:<o:p></o:p>
John,Smith,University,Hospital/GraduateSchool/(All),94421
<o:p></o:p>
<o:p></o:p>
Hope this make sense. ANY help will be gratefully appreciated.
 
First this line should be as below (this is about the 3 line down)
Althought it won't make any difference to the code.
Code:
ReDim ray(1 To Rng.Count, 1 To 16)

Q(1) Have you run the code on the last lot of data you sent me ??
Q(2) Have you actually got a sheet (2), as shown at the bottom of the code.???
Q(3) What was the line it failed on.??
Mick
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Got it....Perfect....Thank you so much!!!

found the problem
Code:
Sheets("Sheet32").Range("A1").Resize(.Count, 16) = ray

Some how I inadverntaly put a 3 in front of the "Sheet32", eventhough i cut and pasted.

Thanks again.
 
Upvote 0
I'm please you found the problem , actually I think it was my fault.
I forgot to alter it, I was using sheet (32) for testing.
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top