Mass find replace - inserting a linebreak

  • Thread starter Thread starter KA
  • Start date Start date
K

KA

I have a small spreadsheet with a variable list of values
in a column ( separated by a comma ). Is there a way to
insert a linebreak character for every instance of a
comma to avoid manual keying of "alt + enter" ( there are
about 500 instances that have to be changed ).

I tried using SUBSTITUTE(A2,",",CHAR(10)). This results
in a small square box in place of the comma.

Any help is appreciated.
+++++++++++++++++++++++++++++++++++++++++++++++
Sample raw data :

Col 1 Col 2
------- ---------
row 1 |Key-A Det A1,Det A2
------- ---------
row 2 |Key-B Det B1
------- ---------
row 3 |Key-C Det C1,Det C2,Det C3
+++++++++++++++++++++++++++++++++++++++++++++++
Expected result

Col 1 Col 2
------- ---------
row 1 |Key-A Det A1
| Det A2
------- ---------
row 2 |Key-B Det B1
------- ---------
row 3 |Key-C Det C1
| Det C2
| Det C3
------- ---------

+++++++++++++++++++++++++++++++++++++++++++++++
 
Select the range and then enter:

Selection.Replace ",", Chr(10)

into the Immediate Window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Reconstructing a table with Arrays 1
*Assistance with formula* 3
ranges 5
vba macro help! 1
Can a formula do this? 1
Tricky Transpose 2
Saving of deleted rows 2
Sheet Cleanup Help Please 5

Back
Top