View Single Post
  #2   Report Post  
Vasant Nanavati
 
Posts: n/a
Default

I don't think you can do this with a formula. You would probably need a
fairly involved macro.

You would need to count the number of line breaks in each cell in column A,
add that many rows below each cell, split the string, remove the line
breaks, and copy the column B information into the new rows. Not difficult,
but quite tedious.

--

Vasant

"adin" wrote in message
...
I've got a sheet with 2 columns - column A has multiple values in one cell
that are separated by carriage returns, and column B next to it has only

one
value per cell.

I'd like to not only strip out these carriage returns, but also (the fun
part) add rows for each value and maintain the reference to the column

next
to it.

Example:

A1 looks like this:

Milk
Eggs
Juice

B1 looks like this:

Food

I'd like A1 to contain the value "Milk" and B1 to contain "Food". A2

should
contain "Eggs" and B2 should contain "Food". C1 should say "Juice", and C2
should say "Food". You get the idea.

Thanks,

Adin