Eliminating blank lines in merge

L

Lin

Using Word XP for document and Excel XP for data. Some cells in Excel are
blank. During the merge, the blank cells result in a blank line. How can I
eliminate the blank lines.
 
D

Doug Robbins - Word MVP

Use and If...then...Else field that test for data in the field. For the
result of the true condition, have it insert that field and a carriage
return and then the next field; for the result of the negative condition,
have it insert just the next field

{ IF { MERGEFIELD fieldthatmightbeblank } <> "" "{ MERGEFIELD
fieldthatmightbeblank }[CarriageRetrun]
{ MERGEFIELD nextfield }" "{ MERGEFIELD nextfield }" }

You must use Ctrl+F9 to insert each pair of field delimiters. In place of
[CarriageReturn] press Enter (or Shift+Enter)

Use Alt+F9 to toggle off the display of the field codes.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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

Top