Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2020, 10:37 PM
macropod's Avatar
macropod macropod is offline Find, Replace using Excel List Windows 7 64bit Find, Replace using Excel List Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could change:
.MatchWholeWord = True
to:
.MatchWholeWord = False
but this might have quite undesirable effects. For example, if the found word also forms part of longer, unrelated, words, those might get updated too. You might get better results inserting:
.MatchAllWordforms = True
after:


.Replacement.ClearFormatting
but that, too can have undesirable results. Test both on a document, with:
.Replacement.Highlight = True
inserted after:
.Replacement.ClearFormatting
and set your preferred highlight colour before running the macro. If you don't get the desired results, you'll need to insert an additional F/R expression for each plural.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 02-24-2020, 09:20 PM
pushpi004 pushpi004 is offline Find, Replace using Excel List Windows 10 Find, Replace using Excel List Office 2016
Novice
Find, Replace using Excel List
 
Join Date: Feb 2020
Posts: 21
pushpi004 is on a distinguished road
Default Issue with plurals

Hi paul,

as suggested by you, I have tried incorporating the new code. Clearly, MatchWholeWord=False doesn't give desired results.

Moving on to .MatchAllWordForms=True, in spite of all types of changes in my test file, database or even some lines of code, it gives a run-time error code 5610, stating that "the find what text for find all word forms can search only alphabetic letters".

My test file has following line, "The school technical library issues Mathematics, Physics and chemistry books to the students and teachers".

The database has following words to be replaced with :-
School to Sch, Library to lib, Technical to Tech, Mathematics to Maths, Physics to Phy, Chemistry to Chem, student to stdnt and teachers to tchr.

The required result must be "The sch tech lib issues Maths, Phy and chem books to the stdnts and tchrs"

I have read online that this function only works with english language and that it wont work along with .MatchWholeWord=True or .MatchCase=True. But even including these changes has not helped.
Reply With Quote
Reply



Similar Threads
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
Find, Replace using Excel List Find and Replace different in Excel 2010? 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
Find, Replace using Excel List Find and Replace using Excel range dmarie123 Word VBA 15 04-02-2013 07:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft