PDA

View Full Version : Find and replace words



MikeAu
01-24-2019, 07:58 AM
I would like to make a macro that find a word in my document and then replace it with something else that the client would write on the spot. I don't know if i'm understood so ill try to make an example. In my document there is lets say a place where we have to put a company name but this company is never the same. So the macro would find lets say“COMPANYNAMETOADD”and then maybe open a box or something where I could just write the company name like “BMHinc" and it would be replaced. Is it possible to do that or something like that?

Thank you

macropod
01-24-2019, 04:19 PM
So what's wrong with using Find/Replace?

MikeAu
01-25-2019, 06:43 AM
Well if people have to do find/replace they'll have to know what has to be replace (in this case COMPANYNAMETOADD) but that's less userfreindly as just like a box that tells you what like "Write your company name here". I don't know if it's possible, maybe not but i still ask in case. Most of the time people that will get the document made by my macros they are not the best at using a computer let's say.

macropod
01-25-2019, 03:40 PM
You could, of course, use bookmarks instead of cryptic text, then all the user need do is press F5>bookmark and select the bookmark to go to for typing. A userform - which is what would be required otherwise - would ordinarily take the bookmark approach, though one might output to content controls instead. See, for example, the discussion at: http://www.msofficeforums.com/word-vba/41474-when-check-box-selected-need-text-written.html