Columns showing $'s and cents in table

B

busyearth

I want to make a column that shows dollars and cents especially when you want
it to automatically calculate that column at the end, this would help me
immensly in a project I am trying to put together using tables.
 
G

Graham Mayor

The simplest solution is to create the table in Excel and link it to your
document.

There is no means of automatically adding dollar and cent symbols to numbers
and if you add them manually, they will not calculate. You could change the
number into a field eg type 32 in the table, select it then run the
following macro:

Sub InsertNumberAsField()
Dim sNum As String
sNum = Selection
If sNum = "" Then Exit Sub
sNum = sNum & " \# ,$0.00"
With Selection.Fields
.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
Text:="= " & sNum, _
PreserveFormatting:=False
.Update
End With
ActiveWindow.View.ShowFieldCodes = False
End Sub

which results in
{ = 32 \# ,$0.00 }
or when toggled (which the macro applies)
$32.00

You can use formulae fields to calculate fields produced in this manner.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
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