PC Review


Reply
Thread Tools Rate Thread

Automating color on specific text.

 
 
G-Artist
Guest
Posts: n/a
 
      9th Jun 2006
Hi,

I have many lists of numbers typed into a Word 2000 document.
Each specific number needs to be one of 3 colors (Red, Black
or Green). So, what I what I would like to do is find a way to
use something like a "search and replace" to alter some of
the current numbers, which are all Black, and change them to
either Red or Green depending on the specific number.

Very, very tedious to do them by hand.

E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.

Doable? How?


Thanks.



 
Reply With Quote
 
 
 
 
Suzanne S. Barnhill
Guest
Posts: n/a
 
      9th Jun 2006
You can use Find and Replace to change the font color. Using wildcards, you
can do more than one number at a time.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"G-Artist" <g-(E-Mail Removed)> wrote in message
news:Qy4ig.3377$(E-Mail Removed)...
> Hi,
>
> I have many lists of numbers typed into a Word 2000 document.
> Each specific number needs to be one of 3 colors (Red, Black
> or Green). So, what I what I would like to do is find a way to
> use something like a "search and replace" to alter some of
> the current numbers, which are all Black, and change them to
> either Red or Green depending on the specific number.
>
> Very, very tedious to do them by hand.
>
> E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
>
> Doable? How?
>
>
> Thanks.
>
>
>


 
Reply With Quote
 
G-Artist
Guest
Posts: n/a
 
      9th Jun 2006

"Suzanne S. Barnhill" <(E-Mail Removed)> wrote in message news:e%(E-Mail Removed)...
> You can use Find and Replace to change the font color. Using wildcards, you
> can do more than one number at a time.


Thanks for the reply. Could you be a bit more specific as to how
that is done? I don't seem to see a color option among the ones
shown.


> Suzanne S. Barnhill
> Microsoft MVP (Word)
> Words into Type
> Fairhope, Alabama USA
> Word MVP FAQ site: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so
> all may benefit.
>
> "G-Artist" <g-(E-Mail Removed)> wrote in message
> news:Qy4ig.3377$(E-Mail Removed)...
> > Hi,
> >
> > I have many lists of numbers typed into a Word 2000 document.
> > Each specific number needs to be one of 3 colors (Red, Black
> > or Green). So, what I what I would like to do is find a way to
> > use something like a "search and replace" to alter some of
> > the current numbers, which are all Black, and change them to
> > either Red or Green depending on the specific number.
> >
> > Very, very tedious to do them by hand.
> >
> > E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
> >
> > Doable? How?
> >
> >
> > Thanks.
> >
> >
> >

>



 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      9th Jun 2006
In the find box put
[135]{1}
in the replace box put
^&
Click the 'More' button
With your cursor in the replace box
Format > font > and check the colour as red
Check the 'Use wildcards' box

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
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



G-Artist wrote:
> "Suzanne S. Barnhill" <(E-Mail Removed)> wrote in message
> news:e%(E-Mail Removed)...
>> You can use Find and Replace to change the font color. Using
>> wildcards, you can do more than one number at a time.

>
> Thanks for the reply. Could you be a bit more specific as to how
> that is done? I don't seem to see a color option among the ones
> shown.
>
>
>> Suzanne S. Barnhill
>> Microsoft MVP (Word)
>> Words into Type
>> Fairhope, Alabama USA
>> Word MVP FAQ site: http://word.mvps.org
>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
>>
>> "G-Artist" <g-(E-Mail Removed)> wrote in message
>> news:Qy4ig.3377$(E-Mail Removed)...
>>> Hi,
>>>
>>> I have many lists of numbers typed into a Word 2000 document.
>>> Each specific number needs to be one of 3 colors (Red, Black
>>> or Green). So, what I what I would like to do is find a way to
>>> use something like a "search and replace" to alter some of
>>> the current numbers, which are all Black, and change them to
>>> either Red or Green depending on the specific number.
>>>
>>> Very, very tedious to do them by hand.
>>>
>>> E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
>>>
>>> Doable? How?
>>>
>>>
>>> Thanks.



 
Reply With Quote
 
G-Artist
Guest
Posts: n/a
 
      9th Jun 2006

"Graham Mayor" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
> In the find box put
> [135]{1}
> in the replace box put
> ^&
> Click the 'More' button
> With your cursor in the replace box
> Format > font > and check the colour as red
> Check the 'Use wildcards' box


I did it all as you laid it out. Nothing gets changed.


> 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
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
>
> G-Artist wrote:
> > "Suzanne S. Barnhill" <(E-Mail Removed)> wrote in message
> > news:e%(E-Mail Removed)...
> >> You can use Find and Replace to change the font color. Using
> >> wildcards, you can do more than one number at a time.

> >
> > Thanks for the reply. Could you be a bit more specific as to how
> > that is done? I don't seem to see a color option among the ones
> > shown.
> >
> >
> >> Suzanne S. Barnhill
> >> Microsoft MVP (Word)
> >> Words into Type
> >> Fairhope, Alabama USA
> >> Word MVP FAQ site: http://word.mvps.org
> >> Email cannot be acknowledged; please post all follow-ups to the
> >> newsgroup so all may benefit.
> >>
> >> "G-Artist" <g-(E-Mail Removed)> wrote in message
> >> news:Qy4ig.3377$(E-Mail Removed)...
> >>> Hi,
> >>>
> >>> I have many lists of numbers typed into a Word 2000 document.
> >>> Each specific number needs to be one of 3 colors (Red, Black
> >>> or Green). So, what I what I would like to do is find a way to
> >>> use something like a "search and replace" to alter some of
> >>> the current numbers, which are all Black, and change them to
> >>> either Red or Green depending on the specific number.
> >>>
> >>> Very, very tedious to do them by hand.
> >>>
> >>> E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
> >>>
> >>> Doable? How?
> >>>
> >>>
> >>> Thanks.

>
>



 
Reply With Quote
 
Suzanne S. Barnhill
Guest
Posts: n/a
 
      9th Jun 2006
It works here. Make sure that the insertion point is in the "Replace with"
box when you format the font color as red. The bug that bites me every time
is that, even though you have the insertion point there when you click More,
it jumps back to "Find what," and you end up applying the font formatting to
"Find what" instead.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"G-Artist" <g-(E-Mail Removed)> wrote in message
news:ZAiig.3620$(E-Mail Removed)...
>
> "Graham Mayor" <(E-Mail Removed)> wrote in message

news:%(E-Mail Removed)...
> > In the find box put
> > [135]{1}
> > in the replace box put
> > ^&
> > Click the 'More' button
> > With your cursor in the replace box
> > Format > font > and check the colour as red
> > Check the 'Use wildcards' box

>
> I did it all as you laid it out. Nothing gets changed.
>
>
> > 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
> > <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >
> >
> >
> > G-Artist wrote:
> > > "Suzanne S. Barnhill" <(E-Mail Removed)> wrote in message
> > > news:e%(E-Mail Removed)...
> > >> You can use Find and Replace to change the font color. Using
> > >> wildcards, you can do more than one number at a time.
> > >
> > > Thanks for the reply. Could you be a bit more specific as to how
> > > that is done? I don't seem to see a color option among the ones
> > > shown.
> > >
> > >
> > >> Suzanne S. Barnhill
> > >> Microsoft MVP (Word)
> > >> Words into Type
> > >> Fairhope, Alabama USA
> > >> Word MVP FAQ site: http://word.mvps.org
> > >> Email cannot be acknowledged; please post all follow-ups to the
> > >> newsgroup so all may benefit.
> > >>
> > >> "G-Artist" <g-(E-Mail Removed)> wrote in message
> > >> news:Qy4ig.3377$(E-Mail Removed)...
> > >>> Hi,
> > >>>
> > >>> I have many lists of numbers typed into a Word 2000 document.
> > >>> Each specific number needs to be one of 3 colors (Red, Black
> > >>> or Green). So, what I what I would like to do is find a way to
> > >>> use something like a "search and replace" to alter some of
> > >>> the current numbers, which are all Black, and change them to
> > >>> either Red or Green depending on the specific number.
> > >>>
> > >>> Very, very tedious to do them by hand.
> > >>>
> > >>> E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
> > >>>
> > >>> Doable? How?
> > >>>
> > >>>
> > >>> Thanks.

> >
> >

>
>


 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      10th Jun 2006
Also it won't find anything to change if the Use wildcards checkbox is not
checked!

If you prefer, the following macro will do the same job:

Sub OneThreeFive_to_red()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[135]{1}"
.Replacement.Text = "^&"
.Replacement.Font.Color = wdColorRed
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub

see http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

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



Suzanne S. Barnhill wrote:
> It works here. Make sure that the insertion point is in the "Replace
> with" box when you format the font color as red. The bug that bites
> me every time is that, even though you have the insertion point there
> when you click More, it jumps back to "Find what," and you end up
> applying the font formatting to "Find what" instead.
>
>
> "G-Artist" <g-(E-Mail Removed)> wrote in message
> news:ZAiig.3620$(E-Mail Removed)...
>>
>> "Graham Mayor" <(E-Mail Removed)> wrote in message

> news:%(E-Mail Removed)...
>>> In the find box put
>>> [135]{1}
>>> in the replace box put
>>> ^&
>>> Click the 'More' button
>>> With your cursor in the replace box
>>> Format > font > and check the colour as red
>>> Check the 'Use wildcards' box

>>
>> I did it all as you laid it out. Nothing gets changed.
>>
>>
>>> 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
>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>
>>>
>>>
>>> G-Artist wrote:
>>>> "Suzanne S. Barnhill" <(E-Mail Removed)> wrote in message
>>>> news:e%(E-Mail Removed)...
>>>>> You can use Find and Replace to change the font color. Using
>>>>> wildcards, you can do more than one number at a time.
>>>>
>>>> Thanks for the reply. Could you be a bit more specific as to how
>>>> that is done? I don't seem to see a color option among the ones
>>>> shown.
>>>>
>>>>
>>>>> Suzanne S. Barnhill
>>>>> Microsoft MVP (Word)
>>>>> Words into Type
>>>>> Fairhope, Alabama USA
>>>>> Word MVP FAQ site: http://word.mvps.org
>>>>> Email cannot be acknowledged; please post all follow-ups to the
>>>>> newsgroup so all may benefit.
>>>>>
>>>>> "G-Artist" <g-(E-Mail Removed)> wrote in message
>>>>> news:Qy4ig.3377$(E-Mail Removed)...
>>>>>> Hi,
>>>>>>
>>>>>> I have many lists of numbers typed into a Word 2000 document.
>>>>>> Each specific number needs to be one of 3 colors (Red, Black
>>>>>> or Green). So, what I what I would like to do is find a way to
>>>>>> use something like a "search and replace" to alter some of
>>>>>> the current numbers, which are all Black, and change them to
>>>>>> either Red or Green depending on the specific number.
>>>>>>
>>>>>> Very, very tedious to do them by hand.
>>>>>>
>>>>>> E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
>>>>>>
>>>>>> Doable? How?
>>>>>>
>>>>>>
>>>>>> Thanks.




 
Reply With Quote
 
G-Artist
Guest
Posts: n/a
 
      10th Jun 2006
WOW!!! Thanks, Graham. The macro works.

Now for the $64 question.... how do I not make the number
10 11 15 17 etc. turn red or partially red?

My list goes from 1-36
1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36
need to be red but the rest stay the default black.

"Graham Mayor" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Also it won't find anything to change if the Use wildcards checkbox is not
> checked!
>
> If you prefer, the following macro will do the same job:
>
> Sub OneThreeFive_to_red()
> Selection.Find.ClearFormatting
> Selection.Find.Replacement.ClearFormatting
> With Selection.Find
> .Text = "[135]{1}"
> .Replacement.Text = "^&"
> .Replacement.Font.Color = wdColorRed
> .Forward = True
> .Wrap = wdFindContinue
> .Format = True
> .MatchCase = False
> .MatchWholeWord = False
> .MatchAllWordForms = False
> .MatchSoundsLike = False
> .MatchWildcards = True
> End With
> Selection.Find.Execute replace:=wdReplaceAll
> End Sub
>
> see http://www.gmayor.com/installing_macro.htm
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
>
> Suzanne S. Barnhill wrote:
> > It works here. Make sure that the insertion point is in the "Replace
> > with" box when you format the font color as red. The bug that bites
> > me every time is that, even though you have the insertion point there
> > when you click More, it jumps back to "Find what," and you end up
> > applying the font formatting to "Find what" instead.
> >
> >
> > "G-Artist" <g-(E-Mail Removed)> wrote in message
> > news:ZAiig.3620$(E-Mail Removed)...
> >>
> >> "Graham Mayor" <(E-Mail Removed)> wrote in message

> > news:%(E-Mail Removed)...
> >>> In the find box put
> >>> [135]{1}
> >>> in the replace box put
> >>> ^&
> >>> Click the 'More' button
> >>> With your cursor in the replace box
> >>> Format > font > and check the colour as red
> >>> Check the 'Use wildcards' box
> >>
> >> I did it all as you laid it out. Nothing gets changed.
> >>
> >>
> >>> 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
> >>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>>
> >>>
> >>>
> >>> G-Artist wrote:
> >>>> "Suzanne S. Barnhill" <(E-Mail Removed)> wrote in message
> >>>> news:e%(E-Mail Removed)...
> >>>>> You can use Find and Replace to change the font color. Using
> >>>>> wildcards, you can do more than one number at a time.
> >>>>
> >>>> Thanks for the reply. Could you be a bit more specific as to how
> >>>> that is done? I don't seem to see a color option among the ones
> >>>> shown.
> >>>>
> >>>>
> >>>>> Suzanne S. Barnhill
> >>>>> Microsoft MVP (Word)
> >>>>> Words into Type
> >>>>> Fairhope, Alabama USA
> >>>>> Word MVP FAQ site: http://word.mvps.org
> >>>>> Email cannot be acknowledged; please post all follow-ups to the
> >>>>> newsgroup so all may benefit.
> >>>>>
> >>>>> "G-Artist" <g-(E-Mail Removed)> wrote in message
> >>>>> news:Qy4ig.3377$(E-Mail Removed)...
> >>>>>> Hi,
> >>>>>>
> >>>>>> I have many lists of numbers typed into a Word 2000 document.
> >>>>>> Each specific number needs to be one of 3 colors (Red, Black
> >>>>>> or Green). So, what I what I would like to do is find a way to
> >>>>>> use something like a "search and replace" to alter some of
> >>>>>> the current numbers, which are all Black, and change them to
> >>>>>> either Red or Green depending on the specific number.
> >>>>>>
> >>>>>> Very, very tedious to do them by hand.
> >>>>>>
> >>>>>> E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
> >>>>>>
> >>>>>> Doable? How?
> >>>>>>
> >>>>>>
> >>>>>> Thanks.

>
>
>



 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      10th Jun 2006
I though that might happen - try plan B

Sub ReplaceList()
Dim vFindText As Variant
Dim vReplText As Variant
Dim i As Long
vFindText = Array("1", "3", "5", "7", "9", "12", _
"14", "16", "18", "19", "21", "23", _
"25", "27", "30", "32", "34", "36")
vReplText = "^&"
With Selection.Find
.Forward = True
.Wrap = wdFindStop
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText
.Replacement.Font.Color = wdColorRed
.Execute replace:=wdReplaceAll
Next i
End With
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

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

G-Artist wrote:
> WOW!!! Thanks, Graham. The macro works.
>
> Now for the $64 question.... how do I not make the number
> 10 11 15 17 etc. turn red or partially red?
>
> My list goes from 1-36
> 1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36
> need to be red but the rest stay the default black.
>
> "Graham Mayor" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Also it won't find anything to change if the Use wildcards checkbox
>> is not checked!
>>
>> If you prefer, the following macro will do the same job:
>>
>> Sub OneThreeFive_to_red()
>> Selection.Find.ClearFormatting
>> Selection.Find.Replacement.ClearFormatting
>> With Selection.Find
>> .Text = "[135]{1}"
>> .Replacement.Text = "^&"
>> .Replacement.Font.Color = wdColorRed
>> .Forward = True
>> .Wrap = wdFindContinue
>> .Format = True
>> .MatchCase = False
>> .MatchWholeWord = False
>> .MatchAllWordForms = False
>> .MatchSoundsLike = False
>> .MatchWildcards = True
>> End With
>> Selection.Find.Execute replace:=wdReplaceAll
>> End Sub
>>
>> see http://www.gmayor.com/installing_macro.htm
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>>
>> Suzanne S. Barnhill wrote:
>>> It works here. Make sure that the insertion point is in the "Replace
>>> with" box when you format the font color as red. The bug that bites
>>> me every time is that, even though you have the insertion point
>>> there when you click More, it jumps back to "Find what," and you
>>> end up applying the font formatting to "Find what" instead.
>>>
>>>
>>> "G-Artist" <g-(E-Mail Removed)> wrote in message
>>> news:ZAiig.3620$(E-Mail Removed)...
>>>>
>>>> "Graham Mayor" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>>> In the find box put
>>>>> [135]{1}
>>>>> in the replace box put
>>>>> ^&
>>>>> Click the 'More' button
>>>>> With your cursor in the replace box
>>>>> Format > font > and check the colour as red
>>>>> Check the 'Use wildcards' box
>>>>
>>>> I did it all as you laid it out. Nothing gets changed.
>>>>
>>>>
>>>>> 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
>>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>>>
>>>>>
>>>>>
>>>>> G-Artist wrote:
>>>>>> "Suzanne S. Barnhill" <(E-Mail Removed)> wrote in message
>>>>>> news:e%(E-Mail Removed)...
>>>>>>> You can use Find and Replace to change the font color. Using
>>>>>>> wildcards, you can do more than one number at a time.
>>>>>>
>>>>>> Thanks for the reply. Could you be a bit more specific as to how
>>>>>> that is done? I don't seem to see a color option among the ones
>>>>>> shown.
>>>>>>
>>>>>>
>>>>>>> Suzanne S. Barnhill
>>>>>>> Microsoft MVP (Word)
>>>>>>> Words into Type
>>>>>>> Fairhope, Alabama USA
>>>>>>> Word MVP FAQ site: http://word.mvps.org
>>>>>>> Email cannot be acknowledged; please post all follow-ups to the
>>>>>>> newsgroup so all may benefit.
>>>>>>>
>>>>>>> "G-Artist" <g-(E-Mail Removed)> wrote in message
>>>>>>> news:Qy4ig.3377$(E-Mail Removed)...
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have many lists of numbers typed into a Word 2000 document.
>>>>>>>> Each specific number needs to be one of 3 colors (Red, Black
>>>>>>>> or Green). So, what I what I would like to do is find a way to
>>>>>>>> use something like a "search and replace" to alter some of
>>>>>>>> the current numbers, which are all Black, and change them to
>>>>>>>> either Red or Green depending on the specific number.
>>>>>>>>
>>>>>>>> Very, very tedious to do them by hand.
>>>>>>>>
>>>>>>>> E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
>>>>>>>>
>>>>>>>> Doable? How?
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks.




 
Reply With Quote
 
G-Artist
Guest
Posts: n/a
 
      4th Sep 2006
Plan B works so very excellently!!!

Thank you ever so much.

It is enough of a pain to have to type in hundreds of numbers
but then manually (and w/o making a mistake) to have
to color them properly is a serious chore.

I really do appreciate the assistance.

"Graham Mayor" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> I though that might happen - try plan B
>
> Sub ReplaceList()
> Dim vFindText As Variant
> Dim vReplText As Variant
> Dim i As Long
> vFindText = Array("1", "3", "5", "7", "9", "12", _
> "14", "16", "18", "19", "21", "23", _
> "25", "27", "30", "32", "34", "36")
> vReplText = "^&"
> With Selection.Find
> .Forward = True
> .Wrap = wdFindStop
> .MatchWholeWord = True
> .MatchWildcards = False
> .MatchSoundsLike = False
> .MatchAllWordForms = False
> .Format = True
> .MatchCase = True
> For i = LBound(vFindText) To UBound(vFindText)
> .Text = vFindText(i)
> .Replacement.Text = vReplText
> .Replacement.Font.Color = wdColorRed
> .Execute replace:=wdReplaceAll
> Next i
> End With
> End Sub
>
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> G-Artist wrote:
> > WOW!!! Thanks, Graham. The macro works.
> >
> > Now for the $64 question.... how do I not make the number
> > 10 11 15 17 etc. turn red or partially red?
> >
> > My list goes from 1-36
> > 1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36
> > need to be red but the rest stay the default black.
> >
> > "Graham Mayor" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Also it won't find anything to change if the Use wildcards checkbox
> >> is not checked!
> >>
> >> If you prefer, the following macro will do the same job:
> >>
> >> Sub OneThreeFive_to_red()
> >> Selection.Find.ClearFormatting
> >> Selection.Find.Replacement.ClearFormatting
> >> With Selection.Find
> >> .Text = "[135]{1}"
> >> .Replacement.Text = "^&"
> >> .Replacement.Font.Color = wdColorRed
> >> .Forward = True
> >> .Wrap = wdFindContinue
> >> .Format = True
> >> .MatchCase = False
> >> .MatchWholeWord = False
> >> .MatchAllWordForms = False
> >> .MatchSoundsLike = False
> >> .MatchWildcards = True
> >> End With
> >> Selection.Find.Execute replace:=wdReplaceAll
> >> End Sub
> >>
> >> see http://www.gmayor.com/installing_macro.htm
> >>
> >> --
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >> Graham Mayor - Word MVP
> >>
> >> My web site www.gmayor.com
> >> Word MVP web site http://word.mvps.org
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>
> >>
> >>
> >> Suzanne S. Barnhill wrote:
> >>> It works here. Make sure that the insertion point is in the "Replace
> >>> with" box when you format the font color as red. The bug that bites
> >>> me every time is that, even though you have the insertion point
> >>> there when you click More, it jumps back to "Find what," and you
> >>> end up applying the font formatting to "Find what" instead.
> >>>
> >>>
> >>> "G-Artist" <g-(E-Mail Removed)> wrote in message
> >>> news:ZAiig.3620$(E-Mail Removed)...
> >>>>
> >>>> "Graham Mayor" <(E-Mail Removed)> wrote in message
> >>> news:%(E-Mail Removed)...
> >>>>> In the find box put
> >>>>> [135]{1}
> >>>>> in the replace box put
> >>>>> ^&
> >>>>> Click the 'More' button
> >>>>> With your cursor in the replace box
> >>>>> Format > font > and check the colour as red
> >>>>> Check the 'Use wildcards' box
> >>>>
> >>>> I did it all as you laid it out. Nothing gets changed.
> >>>>
> >>>>
> >>>>> 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
> >>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>>>>
> >>>>>
> >>>>>
> >>>>> G-Artist wrote:
> >>>>>> "Suzanne S. Barnhill" <(E-Mail Removed)> wrote in message
> >>>>>> news:e%(E-Mail Removed)...
> >>>>>>> You can use Find and Replace to change the font color. Using
> >>>>>>> wildcards, you can do more than one number at a time.
> >>>>>>
> >>>>>> Thanks for the reply. Could you be a bit more specific as to how
> >>>>>> that is done? I don't seem to see a color option among the ones
> >>>>>> shown.
> >>>>>>
> >>>>>>
> >>>>>>> Suzanne S. Barnhill
> >>>>>>> Microsoft MVP (Word)
> >>>>>>> Words into Type
> >>>>>>> Fairhope, Alabama USA
> >>>>>>> Word MVP FAQ site: http://word.mvps.org
> >>>>>>> Email cannot be acknowledged; please post all follow-ups to the
> >>>>>>> newsgroup so all may benefit.
> >>>>>>>
> >>>>>>> "G-Artist" <g-(E-Mail Removed)> wrote in message
> >>>>>>> news:Qy4ig.3377$(E-Mail Removed)...
> >>>>>>>> Hi,
> >>>>>>>>
> >>>>>>>> I have many lists of numbers typed into a Word 2000 document.
> >>>>>>>> Each specific number needs to be one of 3 colors (Red, Black
> >>>>>>>> or Green). So, what I what I would like to do is find a way to
> >>>>>>>> use something like a "search and replace" to alter some of
> >>>>>>>> the current numbers, which are all Black, and change them to
> >>>>>>>> either Red or Green depending on the specific number.
> >>>>>>>>
> >>>>>>>> Very, very tedious to do them by hand.
> >>>>>>>>
> >>>>>>>> E.g. 1 2 3 4 5 6 - the 1, 3, 5 need to be red.
> >>>>>>>>
> >>>>>>>> Doable? How?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Thanks.

>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Searching for specific text color Jay Freedman Microsoft Word Document Management 0 23rd Oct 2010 02:06 AM
Change color of specific text piece Faraz A. Qureshi Microsoft Excel Programming 4 20th Jan 2010 06:39 AM
Change the color of text at a specific location on each text line =?Utf-8?B?QnJpYW4gQ29vaw==?= Microsoft C# .NET 7 26th Sep 2007 02:14 PM
Change color of specific text within a cell? avarga82@gmail.com Microsoft Excel Programming 0 13th Jul 2006 04:58 PM
Find and replace a specific highlighted color in a selected text to a different color =?Utf-8?B?U3RlZW4=?= Microsoft Word Document Management 1 29th Apr 2004 04:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:35 PM.