Forum Discussion
Phishdawg
Jan 25, 2025Brass Contributor
Show Number Values as Currency
I have a Word template with a repeating table in which are fields intended for currency. I am trying to figure out how to dynamically apply the '$' and show the decimal placing so that content l...
Kidd_Ip
Jan 26, 2025MVP
Try this out:
- Using Fields:
- Place the cursor where you want the currency value to appear.
- Press Ctrl+F9 to insert a field.
- Type = and then the value or reference to the field containing the number.
- Press Shift+F9 to toggle between the field code and its value.
- You can add formatting codes to the field like { =1234.56 \# "$#,##0.00" }.
- Using Content Controls with Macros:
- Insert Plain Text Content Control where you want the currency to appear, but don't type the dollar sign ($) manually.
- Use a Macro to format these fields. Here is a sample VBA code that formats content controls as currency:
Sub FormatCurrency()
For Each cc In ActiveDocument.ContentControls
If cc.Type = wdContentControlText Then
If IsNumeric(cc.Range.Text) Then
cc.Range.Text = Format(cc.Range.Text, "$#,##0.00")
End If
End If
Next cc
End Sub
- Using Quick Parts:
- Go to Insert -> Quick Parts -> Field.
- Select Field Codes... and type in the currency formatting you need.
- Save the Quick Part for future use.