ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to search and replace info on modules (https://www.excelbanter.com/excel-programming/350262-code-search-replace-info-modules.html)

Brett Smith[_2_]

Code to search and replace info on modules
 
I am looking to write an automated program in VBA where it will search and
replace several variables with updated names. I also need to update
different template or VBA projects in order to do this because there are many
Excel projects that also need to be updated in the same directory. How would
I code this to automatically open up Excel worksheets, replace variables in
the VBA macro code in order to update it, and then close it when done. Then
it would open up the next Excel worksheet. Anybody have an idea?

Brett

Tom Ogilvy

Code to search and replace info on modules
 
Here is a start

http://www.cpearson.com/excel/vbe.htm

--
Regards,
Tom Ogilvy


"Brett Smith" wrote in message
...
I am looking to write an automated program in VBA where it will search and
replace several variables with updated names. I also need to update
different template or VBA projects in order to do this because there are

many
Excel projects that also need to be updated in the same directory. How

would
I code this to automatically open up Excel worksheets, replace variables

in
the VBA macro code in order to update it, and then close it when done.

Then
it would open up the next Excel worksheet. Anybody have an idea?

Brett




Brett Smith[_2_]

Code to search and replace info on modules
 
Thanks Tom. This should be a good start. Thanks once again. I will use
this and apply a change text sub as opposed to the delete or add text sub
when writing a VBA macro. But how do you search all subdirectories within a
given directory and be able to change modules from there?

Brett

"Tom Ogilvy" wrote:

Here is a start

http://www.cpearson.com/excel/vbe.htm

--
Regards,
Tom Ogilvy


"Brett Smith" wrote in message
...
I am looking to write an automated program in VBA where it will search and
replace several variables with updated names. I also need to update
different template or VBA projects in order to do this because there are

many
Excel projects that also need to be updated in the same directory. How

would
I code this to automatically open up Excel worksheets, replace variables

in
the VBA macro code in order to update it, and then close it when done.

Then
it would open up the next Excel worksheet. Anybody have an idea?

Brett






All times are GMT +1. The time now is 01:16 PM.

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