Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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 |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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 |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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: 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 |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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 |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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 |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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 |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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" wrote in message ... 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 |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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: 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" wrote in message ... 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 |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How Find 0 but not 0.5
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: 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find duplicate text using copy and paste, not Find and Replace | Microsoft Word Help | |||
How to find text in Word in reverse direction: edit find previous | Microsoft Word Help | |||
Find multiple characters in one find using MSword find/replace | Microsoft Word Help | |||
find entry does not find record in datasource under word 2003 | Mailmerge | |||
How to do text find, selecting range from start to find point? | Microsoft Word Help |