How to format cells in a table for currency

G

Guest

I have created a table in Word 2000. 90% of the entries will be text that I
need to manipulate, so I don't want to use an Excel table becuase it limits
my text formatting.

However, one column of the table will be all currency entries. How can I
format the cells for currency? I.E. if I enter 358760, it displays as
$3,587.60.

Thanks for any help
 
G

Greg Maxey

Jim,

You could do this using a protected form where the fields in the one column
where format with a currency format switch. Another opition is to run a
macro to format the desired (say selected) cells before printing or
distributing a smooth document. Something like this may work for you:

Sub ConvertSelectedRawNumbersInTableToCurrencyFormat()

If Not Selection.Information(wdWithInTable) Then
MsgBox "Place cursor in a table cell or select multiple cells."
Exit Sub
End If

Dim oCl As Word.Cell
Dim oRng As Range
Dim Count As Integer
For Each oCl In Selection.Cells
Set oRng = oCl.Range
oRng.End = oRng.End - 1
With oRng
If IsNumeric(oRng) Then
.Text = FormatCurrency _
(Expression:=.Text, _
NumDigitsAfterDecimal:=2, _
IncludeLeadingDigit:=vbTrue, _
UseParensForNegativeNumbers:=vbTrue)
End If
If IsNumeric(oRng) = False Then
Count = Count + 1
End If
End With
Next oCl
If Count = 0 Then
MsgBox "Conversion complete."
End If
Selection.Collapse wdCollapseEnd
If Count = 1 Then
MsgBox "The selected cell is empty or content is not numerical.", ,
"Notice!!"
End If
If Count > 1 Then
MsgBox "" & Count & " of the selected cells are empty or content is not
numerical. Conversion complete on all selected numerical cells.", ,
"Notice!!"
End If
End Sub
 
S

Suzanne S. Barnhill

This can't be done without a field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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