Reply
 
Thread Tools Display Modes
  #1   Report Post  
Chappy
 
Posts: n/a
Default How to find and replace a number range in MS Word

Hi, I'm trying to do a Find and Replace function in MS Word to find all
numbers ranging between 0 and 999999 and to effectively delete these. Does
anyone know how to construct this in the Find and Replace function?

Thanks in advance. Chaps
  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

Wildcard search for

[0-9]

replace with nothing

will delete all numbers from the document. If you want to remove the space
also, you would need

[0-9]{1,6}[ ]

replace with nothing.

The square brackets around the space are unnecessary, yoiu can leave them or
not as you wish.

See http://www.gmayor.com/replace_using_wildcards.htm

--

Graham Mayor - Word MVP

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


See http://www.gmayor.com/replace_using_wildcards.htm


Chappy wrote:
Hi, I'm trying to do a Find and Replace function in MS Word to find
all numbers ranging between 0 and 999999 and to effectively delete
these. Does anyone know how to construct this in the Find and Replace
function?

Thanks in advance. Chaps



  #3   Report Post  
Chappy
 
Posts: n/a
Default

Hi Graham,

Thanks for your reply. However I am not looking to remove all numbers in the
document, I am only seeking to remove the range 0-999999. What I want to keep
in my document is all numbers that contain 7 digits or more. Any numbers that
contain 6 digits or less I wish to remove.

Example: I wish to remove all numbers such as 1, 14, 399, 6666, 12345,
999999 but if they are 1234567 or 9876543210 then I wish to keep them.

Thanks,

chappy
"Graham Mayor" wrote:

Wildcard search for

[0-9]

replace with nothing

will delete all numbers from the document. If you want to remove the space
also, you would need

[0-9]{1,6}[ ]

replace with nothing.

The square brackets around the space are unnecessary, yoiu can leave them or
not as you wish.

See http://www.gmayor.com/replace_using_wildcards.htm

--

Graham Mayor - Word MVP

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


See http://www.gmayor.com/replace_using_wildcards.htm


Chappy wrote:
Hi, I'm trying to do a Find and Replace function in MS Word to find
all numbers ranging between 0 and 999999 and to effectively delete
these. Does anyone know how to construct this in the Find and Replace
function?

Thanks in advance. Chaps




  #4   Report Post  
Herb Tyson [MVP]
 
Posts: n/a
Default

Try this, with Use Wildcards enabled.

Find what:[!0-9][0-9]{1,6}[!0-9]

Replace with:leave blank

If your document begins with a number qualified for deletion, then that
number will be missed by the search. All other numbers containing 1 to 6
digits will be deleted.

[!0-9]= Not a number

[0-9]{1,6}=Numbers with 1 to 6 digits

[!0-9]=Not a number

So, basically, it searches for 1 to 6 digit numbers that are brackets by
non-numbers.

--
Herb Tyson MS MVP
Please respond in the newsgroups so everyone can follow along.
"Chappy" wrote in message
...
Hi Graham,

Thanks for your reply. However I am not looking to remove all numbers in
the
document, I am only seeking to remove the range 0-999999. What I want to
keep
in my document is all numbers that contain 7 digits or more. Any numbers
that
contain 6 digits or less I wish to remove.

Example: I wish to remove all numbers such as 1, 14, 399, 6666, 12345,
999999 but if they are 1234567 or 9876543210 then I wish to keep them.

Thanks,

chappy
"Graham Mayor" wrote:

Wildcard search for

[0-9]

replace with nothing

will delete all numbers from the document. If you want to remove the
space
also, you would need

[0-9]{1,6}[ ]

replace with nothing.

The square brackets around the space are unnecessary, yoiu can leave them
or
not as you wish.

See http://www.gmayor.com/replace_using_wildcards.htm

--

Graham Mayor - Word MVP

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


See http://www.gmayor.com/replace_using_wildcards.htm


Chappy wrote:
Hi, I'm trying to do a Find and Replace function in MS Word to find
all numbers ranging between 0 and 999999 and to effectively delete
these. Does anyone know how to construct this in the Find and Replace
function?

Thanks in advance. Chaps






  #5   Report Post  
Chappy
 
Posts: n/a
Default

Thanks Herb, it works a treat!

"Herb Tyson [MVP]" wrote:

Try this, with Use Wildcards enabled.

Find what:[!0-9][0-9]{1,6}[!0-9]

Replace with:leave blank

If your document begins with a number qualified for deletion, then that
number will be missed by the search. All other numbers containing 1 to 6
digits will be deleted.

[!0-9]= Not a number

[0-9]{1,6}=Numbers with 1 to 6 digits

[!0-9]=Not a number

So, basically, it searches for 1 to 6 digit numbers that are brackets by
non-numbers.

--
Herb Tyson MS MVP
Please respond in the newsgroups so everyone can follow along.
"Chappy" wrote in message
...
Hi Graham,

Thanks for your reply. However I am not looking to remove all numbers in
the
document, I am only seeking to remove the range 0-999999. What I want to
keep
in my document is all numbers that contain 7 digits or more. Any numbers
that
contain 6 digits or less I wish to remove.

Example: I wish to remove all numbers such as 1, 14, 399, 6666, 12345,
999999 but if they are 1234567 or 9876543210 then I wish to keep them.

Thanks,

chappy
"Graham Mayor" wrote:

Wildcard search for

[0-9]

replace with nothing

will delete all numbers from the document. If you want to remove the
space
also, you would need

[0-9]{1,6}[ ]

replace with nothing.

The square brackets around the space are unnecessary, yoiu can leave them
or
not as you wish.

See http://www.gmayor.com/replace_using_wildcards.htm

--

Graham Mayor - Word MVP

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


See http://www.gmayor.com/replace_using_wildcards.htm


Chappy wrote:
Hi, I'm trying to do a Find and Replace function in MS Word to find
all numbers ranging between 0 and 999999 and to effectively delete
these. Does anyone know how to construct this in the Find and Replace
function?

Thanks in advance. Chaps






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 to insert a Symbol into the Find and Replace Function in Word EamonX1 Microsoft Word Help 5 May 16th 05 12:48 PM
Problem with function "Find and Replace" in Word. Pat Microsoft Word Help 3 March 16th 05 01:04 PM
How do I find and replace a superscript number in a word? Steve Starling Microsoft Word Help 2 January 28th 05 04:38 AM
Find and Replace Locks Up Word Karine Rivet Formatting Long Documents 1 January 22nd 05 06:21 AM
Find and Replace Locks Up Word Karine Rivet Microsoft Word Help 0 January 21st 05 10:01 PM


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