Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How to format cells in a table for currency
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 -- Jim |
#2
|
|||
|
|||
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 -- Greg Maxey/Word MVP See: http://gregmaxey.mvps.org/word_tips.htm For some helpful tips using Word. Jim wrote: 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 |
#3
|
|||
|
|||
This can't be done without a field.
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Jim" wrote in message ... 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 -- Jim |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I set a default table format? | Tables | |||
Protect table cells in Word format from hard returns | Microsoft Word Help | |||
Can I freeze the size and format of table cells then type in the . | Tables | |||
Table AutoFormats vs. Table Styles confusion | Tables | |||
Getting the format of a table | Tables |