Link to home
Start Free TrialLog in
Avatar of swpa_wnt
swpa_wntFlag for United States of America

asked on

Extra spaces in number in Word 2007 merge field

I've set up a Word doc with form fields that will be used to merge numerical data from Excel.  By default, the numbers lose their comma when they appear in Word, so I added a switch to the field code. For example: { MERGEFIELD  ADJUST \# ##,### }, where ADJUST is the column name in Excel.  The use of ##,### tells Word what the maximum number of digits will be in a number, and where to place the comma.  For numbers that don't require all those digits, each unnecessary # is replaced with a space.  So, for a small number like 200, the mergefield displays "[space][space]200".  This would be fine if my numbers were in a table, but these numbers are included in sentences, and the extra spaces are not acceptable. Is there an additional switch I can add to the mergefield code that will replace each unnecessary # with NOTHING instead of a space?
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Try "#,##0". This will drop all leading zeros except the last one.
Avatar of swpa_wnt

ASKER

Hi, Graham,

Nope, no difference with that change.
ASKER CERTIFIED SOLUTION
Avatar of swpa_wnt
swpa_wnt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, I guess my question turned into a non-issue after all. If you have no objection, Graham, I'll just delete it.
I discovered a code format that worked for my purposes.