Automate the Excel VB Editor Find and Replace

J

jtedge

Is it possible to write vba code that executes the Excel VB Editor Find and Replace function? If so how?
 
C

Chip Pearson

There is no way to automate the full find and replace
functionality in the VBE. It doesn't support a Replace method.
The CodeModule object does support a Find method, so you could
use this to search for the desired text, use the Lines method to
get the text, modify the text as required, use DeleteLines to
delete the existing line and finally InsertLines to insert the
modified text in to the CodeModule.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



jtedge said:
Is it possible to write vba code that executes the Excel VB
Editor Find and Replace function? If so how?
 
Top