Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
L. Mohan Arun L. Mohan Arun is offline
external usenet poster
 
Posts: 26
Default Replacing numbers automatically

Is there a way to get this done in Word:

I type 4126 it should produce 4,126.
I type 39922 it should produce 39,922.

In short I am looking to format the number automatically.

---------------
Read my blog
http://interestsblog.blogspot.com
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Replacing numbers automatically

No automatic method, short of pressing the comma key where required.
the following macro will format a selected number

Sub FormattedNumber()
Dim sNum As String
sNum = Selection
If sNum = "" Then Exit Sub
If sNum Int(sNum) Then
sNum = format(sNum, "###,###,###,###.##")
Else
sNum = format(sNum, "###,###,###,###")
End If
Selection.TypeText sNum
End Sub

but it is just as quick to manually insert the commas.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



L. Mohan Arun wrote:
Is there a way to get this done in Word:

I type 4126 it should produce 4,126.
I type 39922 it should produce 39,922.

In short I am looking to format the number automatically.

---------------
Read my blog
http://interestsblog.blogspot.com



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with caption numbers when replacing pictures Fabricator Formatting Long Documents 3 December 23rd 08 01:27 AM
How to add a counter in Word? The numbers automatically go up Jenn Microsoft Word Help 1 January 10th 06 09:42 PM
Replacing text, instead of replacing, text inserts alongside word Margaret Minker Microsoft Word Help 4 December 9th 05 03:52 PM
Is there a TOC which automatically updates header numbers for eac. PStachel Microsoft Word Help 2 March 15th 05 02:04 PM
Replacing style of paragraphs with another style automatically Shailesh Microsoft Word Help 3 December 21st 04 07:25 PM


All times are GMT +1. The time now is 09:27 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"