#1
|
|||
|
|||
Need Macro to Replace Text
I have the following text in a document:
A. This answer is incorrect. B. This answer is incorrect. C. This answer is incorrect. D. Answer D is correct. This is the output that I would like to get with a macro/code : Answer (A) is incorrect. Answer (B) is incorrect. Answer (C) is incorrect Answer (D) is correct. Thanks! |
#2
|
||||
|
||||
You don't need a macro for that - you can use a wildcard Find/Replace, where:
Find = ([A-Z]).*[Aa]nswer*( is[ in]{1,3}correct.) Replace = Answer (\1)\2 Of course, you could incorporate it into a macro such as the last one I gave you ...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks! Working great!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to find text and replace with form field containing that text | iiiiifffff | Word VBA | 16 | 06-04-2016 01:47 AM |
Need Macro to Replace Certain Text | rsrasc | Word VBA | 2 | 10-24-2014 06:05 AM |
Help: how to replace hidden text with unhidden text when typing over | jdcornelius | Word | 6 | 03-28-2014 01:19 PM |
Word VBA Macro to Find and Replace based on the Alt Text of an Image | bennymc | Word VBA | 1 | 01-27-2014 04:23 PM |
Macro to Replace Fonts | ballj_35 | Word | 3 | 05-10-2011 01:10 AM |