Hello,
Is there a way to have word automatically add a comma whenever a typed in number reaches past 4 digits? Right now, I'm manually adding in a comma to write numbers such as $1,000,000.
April 9, 2024
Click here to learn more 💡
May 10, 2024
Hello,
Is there a way to have word automatically add a comma whenever a typed in number reaches past 4 digits? Right now, I'm manually adding in a comma to write numbers such as $1,000,000.
Reported content has been submitted
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
Reported content has been submitted
4 people found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Hello,
I tried running the marco but it has been erroring out or not adding the commas.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Hello,
It works now. I don't know why it wasn't working at first. Thanks so much!
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.