![]() |
#11
|
|||
|
|||
![]()
Hi Paul,
I have found the solution for my problem. The issue with .MatchAllWordForms is that it does not work if the word/string consists of more than a word. So, using instr(.text, " "), i checked if the .text from xlFlist has space or not. If yes, then, I used .MatchWholeWord=True, else, I used MatchAllWordForms=true. The results of this simple if else construct gave the answer. thus, there is no requirement of creating a separate F/R list of plurals. THE CODE I USED IS COPIED BELOW :- Code:
With wdDoc With .Range.Find .ClearFormatting .Replacement.ClearFormatting .Replacement.Highlight = True .MatchCase = False .Wrap = wdFindContinue For i = 1 To UBound(Split(xlFList, "|")) .Text = Split(xlFList, "|")(i) 'checking if checked word has spaces i.e. it comprises of multiple words If InStr(.Text, " ") = 0 Then .MatchWholeWord = False .MatchAllWordForms = True .Replacement.Text = Split(xlRList, "|")(i) .Execute Replace:=wdReplaceAll Else .MatchAllWordForms = False .MatchWholeWord = True .Replacement.Text = Split(xlRList, "|")(i) .Execute Replace:=wdReplaceAll End If Next End With Regards Last edited by macropod; 02-26-2020 at 04:10 AM. Reason: Added code tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find and replace multiple values, according to table value - excel formula | EtanM | Excel Programming | 3 | 04-11-2016 01:43 AM |
![]() |
admyers | Excel | 1 | 09-16-2015 10:28 AM |
Find/Replace is not working - Excel 2010 | fieldhaven | Excel | 2 | 02-19-2014 08:30 AM |
Find - Replace Macro using a table list | mdw | Word | 0 | 08-01-2013 04:36 PM |
![]() |
dmarie123 | Word VBA | 15 | 04-02-2013 07:54 AM |