Group:  Microsoft Word ยป microsoft.public.word.docmanagement
Thread: How Find 0 but not 0.5

Geek News

How Find 0 but not 0.5
Jay 12/9/2008 3:13:21 PM
I am using Microsoft Word 2002. I have a table of numerical values that range
mostly from 0 to 9. But occasionally I have to include the value 0.5
(one-half).


At times I want to eliminate all the whole number zeros and replace them
with blank spaces. I know how to do this with the find/replace function, but
the problem is when I do this it also eliminates the leading zero on any of
my 0.5 values.

I only want to replace any whole number zeros, not the zero in 0.5. Does
anyone know how to accomplish this?

Thanks

RE: How Find 0 but not 0.5
PJY 12/9/2008 4:01:01 PM
try searching 0^p (zero plus paragraph mark)
Hope that helps!

"Jay" wrote:

[Quoted Text]
> I am using Microsoft Word 2002. I have a table of numerical values that range
> mostly from 0 to 9. But occasionally I have to include the value 0.5
> (one-half).
>
>
> At times I want to eliminate all the whole number zeros and replace them
> with blank spaces. I know how to do this with the find/replace function, but
> the problem is when I do this it also eliminates the leading zero on any of
> my 0.5 values.
>
> I only want to replace any whole number zeros, not the zero in 0.5. Does
> anyone know how to accomplish this?
>
> Thanks
>
RE: How Find 0 but not 0.5
Jay 12/9/2008 6:51:02 PM
Thanks for responding do you mean to place the term 0^p
in the FIND box?

Is the (zero plus paragraph mark) you refer to the 3 characters of 0^p

I tried placing the term 0^p in the FIND box, and after I click the
REPLACE ALL button I get the warning that ^p is not a valid special
character.

Can you explain a little further.

THANKS AGAIN



"PJY" wrote:

[Quoted Text]
> try searching 0^p (zero plus paragraph mark)
> Hope that helps!
>
> "Jay" wrote:
>
> > I am using Microsoft Word 2002. I have a table of numerical values that range
> > mostly from 0 to 9. But occasionally I have to include the value 0.5
> > (one-half).
> >
> >
> > At times I want to eliminate all the whole number zeros and replace them
> > with blank spaces. I know how to do this with the find/replace function, but
> > the problem is when I do this it also eliminates the leading zero on any of
> > my 0.5 values.
> >
> > I only want to replace any whole number zeros, not the zero in 0.5. Does
> > anyone know how to accomplish this?
> >
> > Thanks
> >
RE: How Find 0 but not 0.5
Jay 12/9/2008 6:53:01 PM
PJY thanks for responding. But do you mean to place the term 0^p
in the FIND box?

Is the (zero plus paragraph mark) you refer to the 3 characters of 0^p

I tried placing the term 0^p in the FIND box, and after I click the
REPLACE ALL button I get the warning that ^p is not a valid special
character.

Can you explain a little further.

THANKS AGAIN

"PJY" wrote:

[Quoted Text]
> try searching 0^p (zero plus paragraph mark)
> Hope that helps!
>
> "Jay" wrote:
>
> > I am using Microsoft Word 2002. I have a table of numerical values that range
> > mostly from 0 to 9. But occasionally I have to include the value 0.5
> > (one-half).
> >
> >
> > At times I want to eliminate all the whole number zeros and replace them
> > with blank spaces. I know how to do this with the find/replace function, but
> > the problem is when I do this it also eliminates the leading zero on any of
> > my 0.5 values.
> >
> > I only want to replace any whole number zeros, not the zero in 0.5. Does
> > anyone know how to accomplish this?
> >
> > Thanks
> >
RE: How Find 0 but not 0.5
PJY 12/9/2008 7:00:01 PM
Yes, that's exactly what I mean - (I'm using 2003) in the Find box put a zero
(0) in the find spot, then go to more, then special (in your find box) select
paragraph mark (^p) and place that directly next to the zero in the find box.
The only thing I can think of why it is not working is the difference in our
versions - it worked perfectly for me

"Jay" wrote:

[Quoted Text]
> PJY thanks for responding. But do you mean to place the term 0^p
> in the FIND box?
>
> Is the (zero plus paragraph mark) you refer to the 3 characters of 0^p
>
> I tried placing the term 0^p in the FIND box, and after I click the
> REPLACE ALL button I get the warning that ^p is not a valid special
> character.
>
> Can you explain a little further.
>
> THANKS AGAIN
>
> "PJY" wrote:
>
> > try searching 0^p (zero plus paragraph mark)
> > Hope that helps!
> >
> > "Jay" wrote:
> >
> > > I am using Microsoft Word 2002. I have a table of numerical values that range
> > > mostly from 0 to 9. But occasionally I have to include the value 0.5
> > > (one-half).
> > >
> > >
> > > At times I want to eliminate all the whole number zeros and replace them
> > > with blank spaces. I know how to do this with the find/replace function, but
> > > the problem is when I do this it also eliminates the leading zero on any of
> > > my 0.5 values.
> > >
> > > I only want to replace any whole number zeros, not the zero in 0.5. Does
> > > anyone know how to accomplish this?
> > >
> > > Thanks
> > >
RE: How Find 0 but not 0.5
Jay 12/9/2008 7:14:04 PM
Before I was typing in 0^p while having the Use Wildcard box checked.
Maybe thats why I recv that error. Anyway I found the paragraph mark under
the special drop down list.

I used that after the zero and when I clicked Replace All, its says 0
replacements were made.

So know it is not finding the individual zeros when I have the 0^p in
the FIND box.

Any ideas?


"PJY" wrote:

[Quoted Text]
> Yes, that's exactly what I mean - (I'm using 2003) in the Find box put a zero
> (0) in the find spot, then go to more, then special (in your find box) select
> paragraph mark (^p) and place that directly next to the zero in the find box.
> The only thing I can think of why it is not working is the difference in our
> versions - it worked perfectly for me
>
> "Jay" wrote:
>
> > PJY thanks for responding. But do you mean to place the term 0^p
> > in the FIND box?
> >
> > Is the (zero plus paragraph mark) you refer to the 3 characters of 0^p
> >
> > I tried placing the term 0^p in the FIND box, and after I click the
> > REPLACE ALL button I get the warning that ^p is not a valid special
> > character.
> >
> > Can you explain a little further.
> >
> > THANKS AGAIN
> >
> > "PJY" wrote:
> >
> > > try searching 0^p (zero plus paragraph mark)
> > > Hope that helps!
> > >
> > > "Jay" wrote:
> > >
> > > > I am using Microsoft Word 2002. I have a table of numerical values that range
> > > > mostly from 0 to 9. But occasionally I have to include the value 0.5
> > > > (one-half).
> > > >
> > > >
> > > > At times I want to eliminate all the whole number zeros and replace them
> > > > with blank spaces. I know how to do this with the find/replace function, but
> > > > the problem is when I do this it also eliminates the leading zero on any of
> > > > my 0.5 values.
> > > >
> > > > I only want to replace any whole number zeros, not the zero in 0.5. Does
> > > > anyone know how to accomplish this?
> > > >
> > > > Thanks
> > > >
Re: How Find 0 but not 0.5
"Tony Jollans" <My forename at my surname dot com> 12/9/2008 7:33:31 PM
Unfortunately, end of cell markers are not identifable with Find and Replace
so you'll either need to use VBA or do it as a three stage process:

1. Find all "0." sequences and change them to some unique sequence not found
elsewhere in the document.
2. Change all (remaining) "0" characters as you wish
3. Replace all (whatever sequence you chose in step 1) with "0."

--
Enjoy,
Tony

www.WordArticles.com

"Jay" <Jay[ at ]discussions.microsoft.com> wrote in message
news:7513BF9A-A22B-402F-B9E1-618B8A58DD41[ at ]microsoft.com...
[Quoted Text]
>I am using Microsoft Word 2002. I have a table of numerical values that
>range
> mostly from 0 to 9. But occasionally I have to include the value 0.5
> (one-half).
>
>
> At times I want to eliminate all the whole number zeros and replace them
> with blank spaces. I know how to do this with the find/replace function,
> but
> the problem is when I do this it also eliminates the leading zero on any
> of
> my 0.5 values.
>
> I only want to replace any whole number zeros, not the zero in 0.5. Does
> anyone know how to accomplish this?
>
> Thanks
>

Re: How Find 0 but not 0.5
Jay 12/9/2008 7:58:07 PM
Tony...I thought about your way and it is an xtra step but works for me.

First I replaced all instances of 0.5 to the dollar sign($). Then I replaced
all whole number zeros to blank spaces then went back and replaced all dollar
signs with 0.5


Thanks again


Wish there was a way to recognize only the whole number zero and not when it
is used as a place holder in a decimal.

"Tony Jollans" wrote:

[Quoted Text]
> Unfortunately, end of cell markers are not identifable with Find and Replace
> so you'll either need to use VBA or do it as a three stage process:
>
> 1. Find all "0." sequences and change them to some unique sequence not found
> elsewhere in the document.
> 2. Change all (remaining) "0" characters as you wish
> 3. Replace all (whatever sequence you chose in step 1) with "0."
>
> --
> Enjoy,
> Tony
>
> www.WordArticles.com
>
> "Jay" <Jay[ at ]discussions.microsoft.com> wrote in message
> news:7513BF9A-A22B-402F-B9E1-618B8A58DD41[ at ]microsoft.com...
> >I am using Microsoft Word 2002. I have a table of numerical values that
> >range
> > mostly from 0 to 9. But occasionally I have to include the value 0.5
> > (one-half).
> >
> >
> > At times I want to eliminate all the whole number zeros and replace them
> > with blank spaces. I know how to do this with the find/replace function,
> > but
> > the problem is when I do this it also eliminates the leading zero on any
> > of
> > my 0.5 values.
> >
> > I only want to replace any whole number zeros, not the zero in 0.5. Does
> > anyone know how to accomplish this?
> >
> > Thanks
> >
>
>
Re: How Find 0 but not 0.5
"Graham Mayor" <gmayor[ at ]REMOVETHISmvps.org> 12/10/2008 6:50:41 AM
You can't use ^p with wildcards use ^13 instead -
http://www.gmayor.com/replace_using_wildcards.htm
However if the numbers are in a table there will probably not be a paragraph
mark after the number so this won't work either. And using replace I foresee
all sorts problems. I suggest a macro would be the better way forward

Sub RemoveZeros()
Dim aTextDoc As Document
Dim cTable As Table
Dim rName As Range
Dim i As Long
Dim j As Long

Set aTextDoc = ActiveDocument
Set cTable = aTextDoc.Tables(1)

For i = 1 To cTable.Rows.Count
For j = 1 To cTable.Columns.Count
Set rName = cTable.Cell(i, j).Range
rName.End = rName.End - 1
If Len(rName) = 1 Then
If rName.Text = "0" Then
rName.Delete
End If
End If
Next j
Next i
End Sub

Will remove entries of 0 from table cells where the cell only contains 0
without affecting cells that contain 0.5 or 10 etc.
The macro checks each cell in each row to see if it contains one character
if it does then it checks whether that character is 0 and if it is it
deletes it.

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


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

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


Jay wrote:
[Quoted Text]
> Before I was typing in 0^p while having the Use Wildcard box
> checked. Maybe thats why I recv that error. Anyway I found the
> paragraph mark under the special drop down list.
>
> I used that after the zero and when I clicked Replace All, its says 0
> replacements were made.
>
> So know it is not finding the individual zeros when I have the 0^p
> in the FIND box.
>
> Any ideas?
>
>
> "PJY" wrote:
>
>> Yes, that's exactly what I mean - (I'm using 2003) in the Find box
>> put a zero (0) in the find spot, then go to more, then special (in
>> your find box) select paragraph mark (^p) and place that directly
>> next to the zero in the find box. The only thing I can think of why
>> it is not working is the difference in our versions - it worked
>> perfectly for me
>>
>> "Jay" wrote:
>>
>>> PJY thanks for responding. But do you mean to place the term
>>> 0^p
>>> in the FIND box?
>>>
>>> Is the (zero plus paragraph mark) you refer to the 3 characters of
>>> 0^p
>>>
>>> I tried placing the term 0^p in the FIND box, and after I
>>> click the REPLACE ALL button I get the warning that ^p is not a
>>> valid special character.
>>>
>>> Can you explain a little further.
>>>
>>> THANKS AGAIN
>>>
>>> "PJY" wrote:
>>>
>>>> try searching 0^p (zero plus paragraph mark)
>>>> Hope that helps!
>>>>
>>>> "Jay" wrote:
>>>>
>>>>> I am using Microsoft Word 2002. I have a table of numerical
>>>>> values that range mostly from 0 to 9. But occasionally I have to
>>>>> include the value 0.5 (one-half).
>>>>>
>>>>>
>>>>> At times I want to eliminate all the whole number zeros and
>>>>> replace them with blank spaces. I know how to do this with the
>>>>> find/replace function, but the problem is when I do this it also
>>>>> eliminates the leading zero on any of my 0.5 values.
>>>>>
>>>>> I only want to replace any whole number zeros, not the zero in
>>>>> 0.5. Does anyone know how to accomplish this?
>>>>>
>>>>> Thanks


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net