Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
how do i display leading zeros when mail merge to Word doc | Mailmerge | |||
Word mail merge from Access - keeping the zeros in numbers | Mailmerge | |||
Zeros as page numbers | Page Layout | |||
Word is adding zeros in front of numbers | Mailmerge | |||
How can I correct my page numbers; they're all zeros? | Microsoft Word Help |