How to embed a non-breaking space in Excel data being used for a mail merge in Word.

dragonfly100

New Member
Joined
Feb 7, 2025
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
VBA Code:

I am trying to keep two merge fields together in a Word mail merge--I would like Address3 which is city, state, to stay on the same line as Postal. In the Word document, non-breaking spaces accomplish this, but I am unable to code the non-breaking spaces into Excel in such a way that they don't get converted to regular spaces upon import. This is a merge of 800+ records.

Any suggestions?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
VBA Code:

I am trying to keep two merge fields together in a Word mail merge--I would like Address3 which is city, state, to stay on the same line as Postal. In the Word document, non-breaking spaces accomplish this, but I am unable to code the non-breaking spaces into Excel in such a way that they don't get converted to regular spaces upon import. This is a merge of 800+ records.

Any suggestions?

Welcome to Mr Excel.

I would set the worksheet up exactly as you would like to see the data in the Word document.

This would involve setting up another column which concatenates the data from the Address and Postal columns.

Does this help?
 
Upvote 0
That seemed like a great solution so i did that, creating a column for "city_state_zip" and changed all the fields in the mail merge. Unfortunately, after all that, when I import the data, it STILL breaks at the spaces between the cities, states and zip codes.
 
Upvote 0
That seemed like a great solution so i did that, creating a column for "city_state_zip" and changed all the fields in the mail merge. Unfortunately, after all that, when I import the data, it STILL breaks at the spaces between the cities, states and zip codes.
When you say 'import the data' do you mean take the Finish and Merge option on the Mailings ribbon in Word?

Do you mean that it forces a line break when it finds a space in a cell value?
 
Upvote 0
That is weird.

Are you able to use XL2BB to submit 10 or more rogue rows of data and an image of the section of the word document containing the merge variables?
I may have misspoke. it does not FORCE a line break, but the line will break at a space. I am trying to keep city, state and zip together.
 
Upvote 0
I may have misspoke. it does not FORCE a line break, but the line will break at a space. I am trying to keep city, state and zip together.
I'm not sure that I understand what the difference is.

Are the values city, state and zip in the same column?
 
Upvote 0
I'm not sure that I understand what the difference is.

Are the values city, state and zip in the same column?
This is a directory mail merge.
 

Attachments

  • roster.JPG
    roster.JPG
    21.4 KB · Views: 2
Upvote 0

Forum statistics

Threads
1,226,516
Messages
6,191,500
Members
453,660
Latest member
Wp1902

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