Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
mj_bowen[_3_] mj_bowen[_3_] is offline
external usenet poster
 
Posts: 4
Default suppress zeros field display for words and numbers

I have an Excel document that has both words and numbers mixed in individual
cells. I would like it so that when the source excel cell is empty a 0 is not
displayed in the word doc. I believe the answer lies with field switches and
i have used the below one which suppresses the 0 if the excel cell is empty
but it also seems to suppress any text when I want the cells contents to be
seen in the word doc.

Text from http://www.gmayor.com/formatting_word_fields.htm

........Suppress field display for numbers =0
You may wish to suppress the field result altogether, when the numeric
content is 0 or a negative number. This can be achieved with a conditional
field, or more simply with a variation on the above numeric switch e.g.
\#"$,0.00;;" Any positive number will display in a dollar format (the dollar
sign being optional again). Zero or negative numbers will display nothing.

The two semi colons at the end determine what happens with negative numbers
and zeros. To understand the principle consider

\# "$,0.00;negative;zero"


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default suppress zeros field display for words and numbers

Hi mj_bowen,

A field switch won't do the job. What you need is an IF test along the lines of:
{IF{MERGEFIELD MyField} "" {MERGEFIELD MyField}}
or, if the 'empty' records actually hold 0s:
{IF{MERGEFIELD MyField} 0 {MERGEFIELD MyField}}

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


"mj_bowen" wrote in message news
I have an Excel document that has both words and numbers mixed in individual
cells. I would like it so that when the source excel cell is empty a 0 is not
displayed in the word doc. I believe the answer lies with field switches and
i have used the below one which suppresses the 0 if the excel cell is empty
but it also seems to suppress any text when I want the cells contents to be
seen in the word doc.

Text from http://www.gmayor.com/formatting_word_fields.htm

.......Suppress field display for numbers =0
You may wish to suppress the field result altogether, when the numeric
content is 0 or a negative number. This can be achieved with a conditional
field, or more simply with a variation on the above numeric switch e.g.
\#"$,0.00;;" Any positive number will display in a dollar format (the dollar
sign being optional again). Zero or negative numbers will display nothing.

The two semi colons at the end determine what happens with negative numbers
and zeros. To understand the principle consider

\# "$,0.00;negative;zero"



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i display leading zeros when mail merge to Word doc relo Mailmerge 1 June 16th 07 03:57 AM
Word mail merge from Access - keeping the zeros in numbers KingTrog Mailmerge 1 June 13th 06 04:45 AM
Zeros as page numbers kfrazzled Page Layout 1 November 1st 05 10:48 PM
Word is adding zeros in front of numbers Nat Mailmerge 6 July 22nd 05 01:12 PM
How can I correct my page numbers; they're all zeros? trainer07 Microsoft Word Help 2 April 26th 05 06:29 PM


All times are GMT +1. The time now is 09:25 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"