Arranging emails format in cell

dessim

New Member
Joined
Aug 4, 2019
Messages
23
Office Version
  1. 2016
Platform
  1. Windows

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Excel Formula:
=SUBSTITUTE(B1,",",CHAR(10))

Make sure you wrap text.
 
Upvote 0
If you didn't want to use another column to do it you could do FIND/REPLACE a couple of times and manually set Wrap Text or you could run this short macro to do the steps.
Test with a copy of the data as it over-writes the original.
If your sample data is accurate you have some CHAR(160) characters that look like space characters but my code will remove those too.

VBA Code:
Sub WrapEmails()
  With Range("B2", Range("B" & Rows.Count).End(xlUp))
    .Value = Evaluate("substitute(substitute(substitute(" & .Address & ",char(160),""""),"" "",""""),"","",char(10))")
  End With
End Sub
 
Upvote 0
surely:
Excel Formula:
=SUBSTITUTE(B1,"; ",CHAR(10))

and don't forget to wrap text
 
Upvote 0
.. or again you could do it in the original cells with Find/Replace. In the Find what box enter ;
In the Replace with box, put your cursor and then type Ctrl+J
You won't see anything in that box but set the other settings as shown then click 'Replace All'
1633467449727.png


.. or again with macro including setting the wrap text and adjusting row height

VBA Code:
Sub SplitEmails()
    With Columns("A")
      .Replace What:=";", Replacement:=Chr(10), LookAt:=xlPart
      .WrapText = True
      .Rows.AutoFit
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,810
Messages
6,121,690
Members
449,048
Latest member
81jamesacct

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