Did you read my post in the thread in the first link you posted? It includes a macro to apply such formatting to numbers in a selected table.
Answer from Paul Edstein on learn.microsoft.comDid you read my post in the thread in the first link you posted? It includes a macro to apply such formatting to numbers in a selected table.
If you insert a Legacy Text Form Field where you want the number
You can then go to the Properties dialog for the FormField and set the type as Number and then select the formatting for the number that you want
FOR THAT TO WORK HOWEVER, THE DOCUMENT MUST BE PROTECTED FOR FILLING IN FORMS, which will severely restrict other things that you can do with the document.
Alternatively, if you insert Content Controls where you want to enter the numbers and you set the Title of each of those Content Controls to "Number", if you have the following code in the ThisDocument object for the document, (or of the Template from which the document is created), the desired formatting will be applied if a number is entered into the Content Control
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim CC As ContentControl
With ActiveDocument
For Each CC In .ContentControls
If CC.Title = "Number" And IsNumeric(CC.Range.Text) Then
CC.Range.Text = Format(CC.Range.Text, "#,##0.00")
End If
Next CC
End With
End Sub
Either the document, or the template from which it is created will need to be saved in Macro enabled format.
How do I insert auto commas on figures on a word document?
"Comma separator in numeric value" transfer from MS excel to MS word document
Automatically adding commas when numbers reach 4 integers or greater
MS Word \# field code formatting, point to comma - Stack Overflow
Videos
Using a format such as \#'##0 to get 19000 to appear as 19'000 suggests that you want the ' to be used as a "thousands separator character". But that can only work if ' is set to be the "digit grouping symbol" in the Regional settings in Windows Control Panel (I'm assuming you're using Windows Word here). That is the default setting for German (Swiss), for example. If you have that setting, then there should be no error, but 19000 will appear as 19'000 and 19000000 will appear as 19'000'000.
If you want ' to appear as a thousands separator when ' is not set as the digit grouping symbol, things are more complicated. First, the normal Unicode U+0027 APOSTROPHE character, and many of the other "single quotation" characters, always have to be inserted in pairs. But if your font has Unicode U+02C8 MODIFIED LETTER VERTICAL LINE (ˈ), you may be able to use that. But then \#ˈ##0 would give you ˈ19000, not 19ˈ000. Further, the ˈ character would always appear, even if you wanted to format "19". ANd it would not replicate every 3 characters.
To deal with that, you would have to use a format string that varied depending on the length of the number that you wanted to format. e.g. if the number was 123, you might use \#0. If it was 1234, you might use \#0ˈ000. If it was 1234567, \#0ˈ000ˈ000, and so on. That can be done, but it isn't simple, probably tricky enough that you might want to find another approach. One reason why it isn't simple is that the result is not numeric, so things will probably go wrong if you try to use the result of the field in another calculation.
Please try these steps:
Method 1:
Open your document.
Click inside the document where you want to insert.
Press the "Ctrl" key and a punctuation key at the same time. It will give grave accent, apostrophe, caret, colon or tilde. The key symbols resemble the accent symbols. For example, press the "Ctrl" key and the apostrophe key to insert an acute accent symbol. Press the "Ctrl" key and the caret key to insert a circumflex symbol.
Press the letter key. The accented character appears.
Method 2:
Open Word.
Select the Insert tab on the Ribbon or click Insert in the Menu bar.
From the dropdown select Symbol option.
You may choose from the limited selection of symbols that appear or click More Symbols.
Select symbol and click on Insert.
Method 3:
Click on Microsoft Office Button, then Word Options.
Click Proofing.
Next AutoCorrect Options.
Click the AutoFormat As You Type tab.
Select or clear the check boxes for the options that you want to enable or disable.
To know what each option do, please visit this site and click on Office.
Hope it helps.
Thank you.
Which version of Word do you use?
What do you mean by “Figures”?
What exact formatting do you want to achieve?
Provide us more information to help you better.
I believe you mean "auto captions." In the Caption dialog, there is an AutoCaption... button that allows you to select which type(s) of graphics will be automatically captioned with the particular type of caption being applied.
The short answer is no, but you could use a macro. Type the number e.g. 1000 or 1000.50 and then run the macro immediately afterwards. It will format as 1,000 or 1,000.50 respectively. If you have typed the comma(s) manually it will check the format. For ease of use assign the macro to a keyboard shortcut - http://www.gmayor.com/installing_macro.htm Note there is no period in the second number string.
Sub FormatNumbers()
Dim orng As Range
Set orng = Selection.Range
orng.MoveStartWhile "0123456789.,", wdBackward
orng.MoveEndWhile "0123456789,"
If InStr(1, orng.Text, ".") > 0 Then
orng = Format(orng.Text, "###,###,###,0.00")
Else
orng = Format(orng.Text, "###,###,###,0")
End If
orng.Collapse wdCollapseEnd
orng.Select
End Sub
Hello,
I tried running the marco but it has been erroring out or not adding the commas.
It's a style guide thing in my op, but if you're writing out numerals that large in a block paragraph, I would recommend using the commas for readability purposes - a string of text numerals is hard to parse - and it also sounds better (I'm relatively sure most people insert pauses between logical digit groupings).
I'll admit to influence being ex APS (Australian Public Service), but we do tend to do a lot of writing and our style guidelines have been hammered out specifically with a view to making sure that the relevant information gets to the eyes of the target reader, in a form with the lowest chance of it being mangled.
Paraphrasing our guide (specific reference below) and personal experience, three other suggestions:
If you can, place the numeric form after the string. The numbers are much easier to scan for in text, and give a quicker indication of 'sizeness'.
five million, two hundred and fifty thousand, four hundred and twenty-two (5 250 422)
I'd also suggest retaining the and within digit blocks. In my op, it's more natural but also binds the numerals together indicating who belongs to which group.
four hundred and twenty-two
not
four hundred twenty two
Finally, hyphenate between the tens and ones of a group of digits, again for readability.
two million, fifty-four thousand, nine hundred and ninety-nine.
not
two million, fifty four thousand, nine hundred and ninety nine.
I thought it was a bit silly when first having to internalise the style guide, but after a while it starts to make sense, for example in a straight side-by-side:
Five million six hundred twenty nine thousand two hundred ninety six
Five million, six hundred and twenty-nine thousand, two hundred and ninety-six (5 629 296)
Of course, your internal guides (or the prevailing style in your area, I have a funny feeling AmE might drop the internal ands for instance) will have their own suggestions, and consistency is king with something like this.
Source: Old habits from a stint in the Australian Public Service as a policy officer, and the Style Manual (6th ed), pg 176. (ISBN 978-0-7016-3648-7)
I think this is a question of readability. From my own experience the use of commas and the breaking up of the numbers into groups of three is optional, however in some ways has become a convention. When converting this into text, the same would apply. In most cases, spelling the number with the same commas as used when in numerical form facilitates readability. The only case where this may become confusing is if you were listing large numbers in a sentence, in which case leave them out.