Find and Replace Problem

R

rpick60

I having a problem replacing the text SHCS' with SHCS 1_2-13x2'
The problem is the single quote at the end. it finds it ok but
replaces it with a apsotrophe when it should be single quote.
I am doing this with a VBA script.
I cannot search just for SHCS becasue my document also text like
SHCS_12'

If i could search for the SHCS' with the single quote and just replace
the "find" without the last character that would work.

Or if I cound find how to replace the apostrophe with the single
quote

I do not know how do either one

Any ideas?
 
D

Doug Robbins - Word MVP

What is the difference between what you call a single quote {'}and an
apostophe {'}? I would call a " a single quote and "" double quotes.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

rpick60

In my program I find apostrophe and replace with apostrophe. But the
replace give me a symbol "prime" chr 2032 when I want a chr 27
apostrophe. I cannot get symbol chr 27.
The prime is also called the full width apostrophe
I hope this helps
('SHCS 1_2-13NC X 1 1_4’,'',(#19560));
It is hard to see but in the above line the ' after 1_4 is different
then ' before the SHCS
 
R

rpick60

I would not have to worry about the character if I new how to find the
SHCS' and only replace the SHCS.
Again I have some other text like SHCS_1' so I cannot just find SHCS
 
D

Doug Robbins - Word MVP

Try using a Wildcard Replace and have it find

(SHCS)(')

where you copy the SHCS' into the vbe and then insert the parentheses, and
in the replace, use

\1 1_2-13x2\2

or use Chr(27) in your code where you want that ASCII character to appear.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

I would not have to worry about the character if I new how to find the
SHCS' and only replace the SHCS.
Again I have some other text like SHCS_1' so I cannot just find SHCS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top