insert commas in dollar figures

D

Dave

Is there a way to automatically insert commas in dollar figures?

For example, if I type $ followed by 1234, I'd like a comma to automatically
insert itself after the 1, thus $1,234 would result.

Thanks

Dave
 
J

Jay Freedman

Is there a way to automatically insert commas in dollar figures?

For example, if I type $ followed by 1234, I'd like a comma to automatically
insert itself after the 1, thus $1,234 would result.

Thanks

Dave

This is something Excel can do automatically, but Word can't.

Word can supply the comma when the number appears in a field, and the
field code contains a "numeric picture switch". Look at the Help topic
"Numeric Picture (\#) field switch".

You could use an Ask field to enter the number, and a Ref field
containing the picture switch to display the result. Or you can use a
Fill-In field, for example:

{FILLIN "dollar amount:" \# $#,###.00}

In either of these cases, you'd have to update the field by selecting
it and pressing F9, or by printing or switching to Print Preview.
Wouldn't it be easier just to type the comma yourself?

The other alternative is a macro that reformats the number, but you'd
have to assign a toolbar button or keyboard shortcut and use that to
start the macro. Again, it would be simpler to just type the comma.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
G

Graham Mayor

No - the best you can manage are to use a field eg {=1234 \# "$,0.00} which
takes longer to insert then the number, or use a vba function from a
keyboard shortcut to prompt for your number then format it as it is inserted
eg

Dim sNum As String
sNum = InputBox("Enter a number to be formatted as currency", _
"Currency")
sNum = Format(sNum, "$###,##0.00")
Selection.TypeText sNum

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top