PDA

View Full Version : concatenate multiple rows



asddsa88
11-09-2011, 02:41 PM
Hello, I am trying to create a macro to concatenate multiple rows (200).
My rows are made of a variable number of individual cells with text inside (from 1 to 10 max).

My aim is to concatenate single cells one after the other in a single row.

Example:

dog cat wolf
owl
[blank row to be automatically skipped or eliminated]
man female

result would be:
dog cat wolf owl man female

ps:
a nice add-on feature would be:
if all the cells in a row are exactly the same and in the same sequence as cells in any other row(s), then keep just 1 row and delete duplicate row(s).

Any ideas?

Thanks in advance!

mdmackillop
11-09-2011, 03:26 PM
I don't see where one concatenation stops and moves on to the next

mikerickson
11-09-2011, 05:00 PM
The ConcatIf function in post #6 should do what you want
http://www.vbaexpress.com/forum/showthread.php?t=36704&highlight=concatif

asddsa88
11-10-2011, 03:31 AM
looking up concatif led me to multicat:

http://mcgimpsey.com/excel/udfs/multicat.html

problem solved!

Thanks guys!