View Single Post
 
Old 03-01-2023, 04:21 AM
paulkaye paulkaye is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Nov 2011
Posts: 84
paulkaye is on a distinguished road
Default Find-replace macro - I got stuck!

Hi all,
I've tried my best to convert the find-replace knowledge that I've learned from here into a macro, but I just can't get it right. I'm trying to build a macro that will convert all instances of:

.{tab}The {text} according to any one of examples {lownum}-{highnum},

into

.{tab}The {text} according to example {lownum},

In the above:
{tab} represent a tab character (e.g. ^t).
{text} can be any text and should remain as-is. If it is difficult to achieve this without unpredictable results, then it would be ok for this to be a single word.
{lownum}-{highnum} represents a range. Their absolute and relative values are unimportant. The number before the hyphen (i.e. {lownum}) should remain as-is, while the hyphen and the number following the hyphen (i.e. {highnum}) should be deleted.
Reply With Quote