Mail Merge and double carriage return

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi

I'm helping someone automate a process and we are performing a mail merge in Word based on an Excel document. There is a text field into which the user enters a description. Often multiple carriage returns are entered in the particular cell in the Excel document using Alt+Enter. This provides some basic formatting to space out the text a little.

What I am seeing in the mail merged document is that a single carriage return (entered using Alt+Enter in Excel) comes through into the mail merge document ok. However, a double carriage return (ie 2 consecutive carriage returns) only ever comes through as one carriage return in the Word document.

Does anyone have any thoughts on why this would be doing this? Or how we can stop the Word document from ignoring the double carriage returns?

Thanks
Andrew
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
SOLVED: Mail Merge and double carriage return

Ah - the penny drops.......

Using Alt+Enter creates a line feed character, aka char(10). To get multiple carriage returns I need to pass multiples of char(14) and char(10).

Andrew
 

Macropod

Retired Moderator
Joined
Aug 27, 2007
Messages
3,513
Hi Andrew,

I think that's char(13) and char(10). However, a simpler way might be to insert a space between the char(10) pairs.

BTW, the fact you're using line-feeds suggests the data really should be in separate columns.
 

Soco13

New Member
Joined
Jun 3, 2013
Messages
2
Re: SOLVED: Mail Merge and double carriage return

Ah - the penny drops.......

Using Alt+Enter creates a line feed character, aka char(10). To get multiple carriage returns I need to pass multiples of char(14) and char(10).

Andrew

I know this is an old thread, but I have the same problem. I need a double line break in my final mail merge document. However, I don't understand Andrew's solution.

How does one manually enter char(10) or char(13) into the Excel cell? I tried typing it into the cell, but then those exact characters ("char(10)") are what showed up in my mail merge final document.

My workaround is to replace the line breaks with an asterisk (*), then after the mail merge is done, do a find/replace within Word to delete all asterisks (find asterisk, replace with nothing), which leaves the blank line. It's a bit tedious, but it works. Can anyone explain an easier way?
 
Last edited:

Macropod

Retired Moderator
Joined
Aug 27, 2007
Messages
3,513

ADVERTISEMENT

Re: SOLVED: Mail Merge and double carriage return

As Andrew already indicated, Alt-Enter create the Char(10) within the cell.
 

Soco13

New Member
Joined
Jun 3, 2013
Messages
2
Re: SOLVED: Mail Merge and double carriage return

As Andrew already indicated, Alt-Enter create the Char(10) within the cell.

Although Alt-enter will put the line break Char(10) within the cell, those line breaks will not translate over to MS Word in a mail merge. Everything in the mail merge just shows up single spaced.

Andrew and I have the same problem.
 

Macropod

Retired Moderator
Joined
Aug 27, 2007
Messages
3,513
Re: SOLVED: Mail Merge and double carriage return

Any character (other than another Alt-Enter) between the Alt-Enter characters (e.g. a space or a tab) will prevent them being treated as one.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,708
Messages
5,597,684
Members
414,164
Latest member
ARTW

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
Top