ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A Macro to Do Find and Replace (https://www.excelbanter.com/excel-programming/291805-macro-do-find-replace.html)

eric

A Macro to Do Find and Replace
 
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.


Bob Phillips[_6_]

A Macro to Do Find and Replace
 
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)

"Eric" wrote in message
...
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

A Macro to Do Find and Replace
 
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


-----Original Message-----
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)

"Eric" wrote in

message
...
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.



.



All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com