A Macro to Do Find and Replace

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hi All, I am writing a macro in Excel 2002 to scan through
a large volume of Excel files trying to find an old
Website name and replace them all with a new one.
Manually, i would go to Excel's VB Editor and go to the
Toolbar to select the Find and Replace All function for
each file. In this macro, how do i call the built-
in "Find" function and automate this process that is able
to update multiple files in one shot?

Thanks all in advance.
 
Eric,

It wouldn't all be in one shot. Firstly you would have to find a way of
identifying all of the files, it could be all files in a directory, or you
could manually build an array. Whatever, once you have the list, you would
open each in turn, iterate through each sheet, do the Find/Replace, save and
close the workbook, and move on.

You could do a macro record of the Find/Replace to get the basic syntax.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hello Bob/Everybody,

Could you pls give details for generating that macro? I
tried, but nothing was actually recorded. I serached
through Excel VB help, but only found FileSearch, not text
search in the VB Editor. Thanks! Eric
 
Back
Top