Reply
 
Thread Tools Display Modes
  #1   Report Post  
Yandros
 
Posts: n/a
Default Word Search and Replace

Hi all,

Can anyone provide me with guidance.

I have a series of comma & space separated values in the format:-

542224452, 5422245#, 54222740, 54223425, 5422346, 542235, 54224140,
54224141#, 542244412, 542244413#, 542244414#, 542244415#, 542244416#,
542244417#, 542244418#.

I'd like use a find and replace function to find all the numbers ending in a
# and replace them with just the number (ie without the #) but in bold (or
another colour ie Red).

Any advice will be gratefully received.

Thanks in advance

Yandros

  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

Use a wildcard replace of
([0-9]{1,})#
with
\1 (with format font red colour & bold set)

--

Graham Mayor - Word MVP

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




Yandros wrote:
Hi all,

Can anyone provide me with guidance.

I have a series of comma & space separated values in the format:-

542224452, 5422245#, 54222740, 54223425, 5422346, 542235, 54224140,
54224141#, 542244412, 542244413#, 542244414#, 542244415#, 542244416#,
542244417#, 542244418#.

I'd like use a find and replace function to find all the numbers
ending in a # and replace them with just the number (ie without the
#) but in bold (or another colour ie Red).

Any advice will be gratefully received.

Thanks in advance

Yandros



  #3   Report Post  
jessi
 
Posts: n/a
Default

you can use a macro like this one (which only converts
one number)

Selection.Find.ClearFormatting
With Selection.Find
.Text = "#"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=2,
Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
-----Original Message-----
Hi all,

Can anyone provide me with guidance.

I have a series of comma & space separated values in the

format:-

542224452, 5422245#, 54222740, 54223425, 5422346,

542235, 54224140,
54224141#, 542244412, 542244413#, 542244414#,

542244415#, 542244416#,
542244417#, 542244418#.

I'd like use a find and replace function to find all the

numbers ending in a
# and replace them with just the number (ie without the

#) but in bold (or
another colour ie Red).

Any advice will be gratefully received.

Thanks in advance

Yandros

.

  #4   Report Post  
Yandros
 
Posts: n/a
Default

Hi Graham,

Thank you very much. This definitely hits the spot. You've saved me a great
deal of time (can you imagine having to do this manually on a series which
contains some 1800 to 2000 values)!

I am very grateful. Thank again for taking the time and effort (and also
finding the solution so quickly too).

"Graham Mayor" wrote:

Use a wildcard replace of
([0-9]{1,})#
with
\1 (with format font red colour & bold set)

--

Graham Mayor - Word MVP

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




Yandros wrote:
Hi all,

Can anyone provide me with guidance.

I have a series of comma & space separated values in the format:-

542224452, 5422245#, 54222740, 54223425, 5422346, 542235, 54224140,
54224141#, 542244412, 542244413#, 542244414#, 542244415#, 542244416#,
542244417#, 542244418#.

I'd like use a find and replace function to find all the numbers
ending in a # and replace them with just the number (ie without the
#) but in bold (or another colour ie Red).

Any advice will be gratefully received.

Thanks in advance

Yandros




  #5   Report Post  
Yandros
 
Posts: n/a
Default

Hi Jesse,

I was really looking for a solution that would convert all the numbers (I
have a list of up 2000 to work through).

However, thank you for taking the time to help me solve the problem

Yandros

"jessi" wrote:

you can use a macro like this one (which only converts
one number)

Selection.Find.ClearFormatting
With Selection.Find
.Text = "#"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=2,
Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
-----Original Message-----
Hi all,

Can anyone provide me with guidance.

I have a series of comma & space separated values in the

format:-

542224452, 5422245#, 54222740, 54223425, 5422346,

542235, 54224140,
54224141#, 542244412, 542244413#, 542244414#,

542244415#, 542244416#,
542244417#, 542244418#.

I'd like use a find and replace function to find all the

numbers ending in a
# and replace them with just the number (ie without the

#) but in bold (or
another colour ie Red).

Any advice will be gratefully received.

Thanks in advance

Yandros

.




  #6   Report Post  
Graham Mayor
 
Posts: n/a
Default

If you want to read the background, 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




Yandros wrote:
Hi Graham,

Thank you very much. This definitely hits the spot. You've saved me a
great deal of time (can you imagine having to do this manually on a
series which contains some 1800 to 2000 values)!

I am very grateful. Thank again for taking the time and effort (and
also finding the solution so quickly too).

"Graham Mayor" wrote:

Use a wildcard replace of
([0-9]{1,})#
with
\1 (with format font red colour & bold set)

--

Graham Mayor - Word MVP

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




Yandros wrote:
Hi all,

Can anyone provide me with guidance.

I have a series of comma & space separated values in the format:-

542224452, 5422245#, 54222740, 54223425, 5422346, 542235, 54224140,
54224141#, 542244412, 542244413#, 542244414#, 542244415#,
542244416#, 542244417#, 542244418#.

I'd like use a find and replace function to find all the numbers
ending in a # and replace them with just the number (ie without the
#) but in bold (or another colour ie Red).

Any advice will be gratefully received.

Thanks in advance

Yandros



  #7   Report Post  
Merrill Mitler Merrill Mitler is offline
Junior Member
 
Posts: 0
Post

Quote:
Originally Posted by Graham Mayor View Post
If you want to read the background, 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




Yandros wrote:
Hi Graham,

Thank you very much. This definitely hits the spot. You've saved me a
great deal of time (can you imagine having to do this manually on a
series which contains some 1800 to 2000 values)!

I am very grateful. Thank again for taking the time and effort (and
also finding the solution so quickly too).

"Graham Mayor" wrote:

Use a wildcard replace of
([0-9]{1,})#
with
\1 (with format font red colour & bold set)

--

Graham Mayor - Word MVP

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




Yandros wrote:
Hi all,

Can anyone provide me with guidance.

I have a series of comma & space separated values in the format:-

542224452, 5422245#, 54222740, 54223425, 5422346, 542235, 54224140,
54224141#, 542244412, 542244413#, 542244414#, 542244415#,
542244416#, 542244417#, 542244418#.

I'd like use a find and replace function to find all the numbers
ending in a # and replace them with just the number (ie without the
#) but in bold (or another colour ie Red).

Any advice will be gratefully received.

Thanks in advance

Yandros
Hello,

This is a related question: How can one search for the following string: "^p, followed by any 3 characters, followed by a space" and replace ONLY the space with a ^t?

I have not been able to use wildcards or other special search characters.

Thanks,
Merrill
Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump


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