View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Bridges[_2_] Bob Bridges[_2_] is offline
external usenet poster
 
Posts: 257
Default Merging multiple cells into a single cell

I have a user-written worksheet function that does that
very thing. In a cell I put, for example, =CONCAT(B2:E2),
and it joins the text values of those cells together. By
default it puts a space between each one, but I can call
=CONCAT(B2:E2,"; ") instead and it'll put the second
string (semicolon-and-space) between each value.

This CAN be done with the MS-provided worksheet
functions, but writing your own is easier in my opinion.
The only problem is that I wrote that function at work
and I don't seem to have a copy of it here; I'll have to
go get it tomorrow.

But here's a minor puzzle: You asked the question in the
Programming forum, so one might assume you know how
to write in VBA and are just looking for a few hints on how
to write this function for yourself. Yet it seems to me if you
know VBA at all, this function would be pretty simple to write.
I don't object to helping you, but did you really mean to ask
this question in the Excel Worksheet Functions forum?

--- "akaDong" wrote:
i have a two column data. I need to merge data from column
b with the same data in column a into a single cell separated
by ";". the sheet looks as follows:

---A--- ---B---
Job ID Name

335119 Malonzo, Elaine
335119 Monsalve, Edmund
335119 Pilapil, Flofer
335119 Pilapil, Flofer
335119 Santiago, Minerva
335212 Calub, Charina
335212 Calub, Charina
335212 Calub, Charina
335212 Requita, Darius
335212 Santiago, Minerva
335253 Bonifacio, DaisyLou
335253 Bonifacio, DaisyLou
335253 Delos Santos, Veronica
335253 Delos Santos, Veronica
335253 Llamas-Ong, Christine
335253 Llamas-Ong, Christine
335253 Reyes, Wilson

I need it to look like this....

---A--- ---B------------------------------------
Job ID Name

335119 Malonzo, Elaine; Monsalve, Edmund; Pilapil,
Flofer; Santiago, Minerva
335212 Calub, Charina; Requita, Darius;
Santiago, Minerva
335253 Bonifacio, DaisyLou; Delos Santos, Veronica;
Llamas-Ong, Christine