Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
spidie_man spidie_man is offline
external usenet poster
 
Posts: 1
Default Wrong (cell) number format when data pulled from xls file to Word

I have an excel 2007 spreadsheet from which some data is being extracted
(using mail merge and SQL) and put in a word document. I am able to get the
data in the word document, but some of the cells are being displayed in
scientific notation. They have 6 or 10 digits after the decimal place, I just
want 2 digits after the decimal place. I have checked the format of the cells
in the excel spreadsheet, over there they are being displayed properly.

In the spreadsheet, all cells have the same format, but only a few of these
cells are not being displayed properly when they are pulled into Word 2007.

Does anyone know how to fix this?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Wrong (cell) number format when data pulled from xls file toWord

Are they really using scientific notation (e.g. 1.234+E5) ? Or are they
showing extra digits because of rounding errors, e.g. 1.459999 rather
than 1.45 ?

If it's rounding errors, you should be able to use numeric format
switches in the relevant MERGEFIELD fields, e.g. use Alt-F9 to show the
field code and change

{ MERGEFIELD mynumber }
or
{ MERGEFIELD mynumber \*Mergeformat }
to e.g.
{ MERGEFIELD mynumber \#0.00 }


If that does not do what you need,
a. you may find the following page useful (although I don't have an
explanation if the numbers really are coming across with E-notation).

http://tips.pjmsn.me.uk/t0003.htm

b. if you are issuing SQL in an OpenDataSource call, you may be able
to use Jet/VBA formatting functions to get the results you need.

Peter Jamieson

http://tips.pjmsn.me.uk

spidie_man wrote:
I have an excel 2007 spreadsheet from which some data is being extracted
(using mail merge and SQL) and put in a word document. I am able to get the
data in the word document, but some of the cells are being displayed in
scientific notation. They have 6 or 10 digits after the decimal place, I just
want 2 digits after the decimal place. I have checked the format of the cells
in the excel spreadsheet, over there they are being displayed properly.

In the spreadsheet, all cells have the same format, but only a few of these
cells are not being displayed properly when they are pulled into Word 2007.

Does anyone know how to fix this?

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
cell number format Helmut Tables 3 August 6th 07 10:18 AM
Table Cell Number Format Pat Falango New Users 1 October 13th 06 02:58 PM
Number format wrong when using a formula in merge field Taz Mailmerge 1 July 19th 06 07:31 PM
The wrong data being pulled from Excel! sally t Mailmerge 1 February 18th 06 08:17 PM
page number format prints wrong 1 of 1, 2 of 2 etc. RickyM Microsoft Word Help 1 October 4th 05 02:15 PM


All times are GMT +1. The time now is 02:18 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"