Quote:
Originally Posted by PieOPah
Is there a more efficient way of doing this - or is there already a macro available I can use?
Many thanks,
|
Yes there is a much more efficient way of doing this, but it gets more complicated.
A better way would be to do a while loop with a case statment inside
Code:
PSUDO CODE
Match = "color|honor|etc..."
Look for match
While (Match not found)
select (match)
case "color"
replace("color","colour")
case "honor"
replace("honor","honour")
end select
Look for match
WEND
This way you only search through the document once and replace each word with the correct selection as you find them.
All the source examples you need are found in the tool BookCreator except for the case statement but a google on "vba select case example" should give you a good example on how to write one.
=X=