Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Extra spaces in number in Word 2007 merge field

Posted on 2012-03-14
5
Medium Priority
?
373 Views
Last Modified: 2012-06-27
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?
0
Comment
Question by:swpa_wnt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37721583
Try "#,##0". This will drop all leading zeros except the last one.
0
 

Author Comment

by:swpa_wnt
ID: 37721666
Hi, Graham,

Nope, no difference with that change.
0
 

Accepted Solution

by:
swpa_wnt earned 0 total points
ID: 37721668
I don't have leading zeros, I have leading spaces.

On edit: Ah, wait, here we go.  Instead of "##,###", I can delete the first two #s but leave the comma, so it is just ",###"  This will work for me, as none of the numbers are less than 3 digits.
0
 

Author Comment

by:swpa_wnt
ID: 37726905
Sorry, I guess my question turned into a non-issue after all. If you have no objection, Graham, I'll just delete it.
0
 

Author Closing Comment

by:swpa_wnt
ID: 37760255
I discovered a code format that worked for my purposes.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question