Mail Merge and double carriage return

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,462
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
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
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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
 
Upvote 0
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.
 
Upvote 0
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:
Upvote 0
Re: SOLVED: Mail Merge and double carriage return

As Andrew already indicated, Alt-Enter create the Char(10) within the cell.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,003
Members
448,935
Latest member
ijat

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