Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2021, 08:49 AM
rosen.j rosen.j is offline Left Leading $ with decimal aligned numbers Windows 10 Left Leading $ with decimal aligned numbers Office 2019
Novice
Left Leading $ with decimal aligned numbers
 
Join Date: Jan 2021
Posts: 2
rosen.j is on a distinguished road
Default Left Leading $ with decimal aligned numbers

I hope someone can help me with this mail merge problem! I'm loading from an excel spreadsheet into a word table. All the rows in the table come from the same row of data in the excel worksheet (it is not many to one).

The table is populating just fine but I can't get the cells formatted correctly for the numeric data. I'd like it to display as:

$ 3,000.00
$ 400.00
$ 1,500.00
$ (20.00)

I'm trying different permutations of \# \f \b with imbedded tabs but nothing I've tried will separate the $ while keeping the number formatting. (I've been ignoring the negative number until I get something working.)

As just one example (Pls excuse my tab representation ->):
{mergefield "cost_1" \# ->$ ->,0.00}

Any advice is much appreciated!
Reply With Quote
  #2  
Old 01-18-2021, 02:42 PM
macropod's Avatar
macropod macropod is offline Left Leading $ with decimal aligned numbers Windows 10 Left Leading $ with decimal aligned numbers Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The \b and \f switches don't work with other switches. Instead, you could code the mergefield as:
{ MERGEFIELD Cost \# "'$→'0.00' '; '$→'(0.00)"}
or:
{ MERGEFIELD Cost \# "'$→'0.00; '$→'-0.00"}
and use a right-aligned tab in the cell.

To suppress 0 outputs, you could code the mergefield as:
{ MERGEFIELD Cost \# "'$→'0.00' '; '$→'(0.00);"}
or:
{ MERGEFIELD Cost \# "'$→'0.00; '$→'-0.00;"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-19-2021, 05:03 PM
rosen.j rosen.j is offline Left Leading $ with decimal aligned numbers Windows 10 Left Leading $ with decimal aligned numbers Office 2019
Novice
Left Leading $ with decimal aligned numbers
 
Join Date: Jan 2021
Posts: 2
rosen.j is on a distinguished road
Default

Wow. That's all I can say is just wow!

It was the single quotes I was missing. I tried it with and without double quotes but never even considered the need for single quotes.

Thanks so much for your help! G'day
Reply With Quote
Reply

Tags
dollar format, tab alignment, table cell

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to format negative values in red, right aligned but have £ sign to the left? Jules90 Excel 0 09-18-2020 03:13 AM
Left Leading $ with decimal aligned numbers Rtl text aligned right and ltr text aligned to left in one line - HOW? wordnew Word 10 09-06-2020 08:23 AM
Left Leading $ with decimal aligned numbers Adding a decimal point in an already existing column of numbers wheddingsjr Excel 3 07-26-2019 07:41 AM
Left Leading $ with decimal aligned numbers Table of Contents - page numbers not aligned to the right in longer headings krneki Word 3 08-17-2015 08:34 AM
Merge, Too many Numbers right of the Decimal Point ohdearme Mail Merge 0 10-25-2009 05:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft