Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
chumba_dude chumba_dude is offline
external usenet poster
 
Posts: 2
Default Replace a constant with an incrementing number

Is there a way in Word to replace a constant with a self incrementing number?
For example, I have a 500+ page Word document, it has a fixed phrase XYZ
repeated many, many times in the document. I need to replace XYZ with a self
incrementing number where I can specify what the starting number would be;
first occurance of XYZ becomes 101000, second occurance of XYZ becomes 101001
etc.
Can I use 'Find and Replace' for what I need to do? Or do I have to get
into Macros?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Herb Tyson [MVP] Herb Tyson [MVP] is offline
external usenet poster
 
Posts: 2,936
Default Replace a constant with an incrementing number

I would create an SEQ field as the counting "seed". Then copy it to the
clipboard so it can be referenced as ^c in the replace field. Finally, I'd
Find/Replace XYZ with ^c.

First... replace the first XYZ with the initial SEQ field that establishes
the starting value. Press Ctrl+F9 (insert field braces) and inside the field
braces type:

seq chumbanumba \r101000

and then press F9. This will create the initial sequence number, 101000.

Second... replace the 2nd XYZ with the instance of the seq field that you
will copy to the clipboard. Press Ctrl+F9 and inside the field braces type:

seq chumbanumba

at the moment, this will look like { seq chumbanumba }. Select the entire
field (including braces) and copy it to the clipboard (Ctrl+C).

Third... press Ctrl+H, and inscribe the Replace/With fields as:

Find what:XYZ

Replace with:^c

Then click Replace All

Finally... select the entire document (Ctrl+A) and update all of the field
codes (Ctrl+F9).

If you don't have any other field codes in the document, you can convert the
fields into "hard" numbering by selecting the document and pressing
Ctrl+Shift+F9.

--
Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com


"chumba_dude" wrote in message
...
Is there a way in Word to replace a constant with a self incrementing
number?
For example, I have a 500+ page Word document, it has a fixed phrase XYZ
repeated many, many times in the document. I need to replace XYZ with a
self
incrementing number where I can specify what the starting number would be;
first occurance of XYZ becomes 101000, second occurance of XYZ becomes
101001
etc.
Can I use 'Find and Replace' for what I need to do? Or do I have to get
into Macros?


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
chumba_dude chumba_dude is offline
external usenet poster
 
Posts: 2
Default Replace a constant with an incrementing number

Thank you so much, I will try it later..

"Herb Tyson [MVP]" wrote:

I would create an SEQ field as the counting "seed". Then copy it to the
clipboard so it can be referenced as ^c in the replace field. Finally, I'd
Find/Replace XYZ with ^c.

First... replace the first XYZ with the initial SEQ field that establishes
the starting value. Press Ctrl+F9 (insert field braces) and inside the field
braces type:

seq chumbanumba \r101000

and then press F9. This will create the initial sequence number, 101000.

Second... replace the 2nd XYZ with the instance of the seq field that you
will copy to the clipboard. Press Ctrl+F9 and inside the field braces type:

seq chumbanumba

at the moment, this will look like { seq chumbanumba }. Select the entire
field (including braces) and copy it to the clipboard (Ctrl+C).

Third... press Ctrl+H, and inscribe the Replace/With fields as:

Find what:XYZ

Replace with:^c

Then click Replace All

Finally... select the entire document (Ctrl+A) and update all of the field
codes (Ctrl+F9).

If you don't have any other field codes in the document, you can convert the
fields into "hard" numbering by selecting the document and pressing
Ctrl+Shift+F9.

--
Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com


"chumba_dude" wrote in message
...
Is there a way in Word to replace a constant with a self incrementing
number?
For example, I have a 500+ page Word document, it has a fixed phrase XYZ
repeated many, many times in the document. I need to replace XYZ with a
self
incrementing number where I can specify what the starting number would be;
first occurance of XYZ becomes 101000, second occurance of XYZ becomes
101001
etc.
Can I use 'Find and Replace' for what I need to do? Or do I have to get
into Macros?



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
How would I print tickets with an incrementing number on them? Jim Farrington Microsoft Word Help 2 March 10th 08 03:16 AM
How to Replace Numbers By Incrementing a Certain Amount? PBJ Microsoft Word Help 0 August 17th 07 02:19 AM
Skip a constant number of records R Alapatt Mailmerge 5 August 25th 06 09:47 PM
annually incrementing number? BobW Microsoft Word Help 3 March 8th 06 02:50 PM
Possible to have incrementing number in header (not page#)? James Page Layout 1 February 9th 05 03:37 PM


All times are GMT +1. The time now is 06:47 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"