How to automate find/replace code in VBA modules in MS Office 2013?

时间:2015-06-15 15:05:44

标签: excel vba excel-vba ms-office vbe

I have a large number of Excel Templates that contain VBA code that need to be updated. The Find method of the code-module object only returns true/false, not the location of the found string.

Is there any way to automate the find-and-replace procedure?

1 个答案:

答案 0 :(得分:2)

将此代码添加到新的启用宏的工作簿。设置ORDERNUMBER 1 2 4 5 6 FIND_WHAT常量,打开其他工作簿并运行代码。

原始代码来自Charles Pearson's site

警告:只进行了基本测试!

REPLACE_WITH