Macro to change text in macro on control button in workbook?

Rookeby7

New Member
Joined
Jul 5, 2019
Messages
18
I have inherited a process which has a template workbook with Macro buttons so users can move to specific sheets.

The template has been used to create approx 700 files.

I have been making some amendments to the template, which has included changing one of the worksheet names - this means one of the macro buttons no longer works as it is looking for a sheet which no longer exists.

:confused: Is it possible to create a macro to open an embedded macro and find/repalce the sheet name? (and loop through 700 files?)

:confused: Or is it possible to assign a new macro to the existing button? (and loop through 700 files?)

Hope someone can help, thanks in advance
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
It could be done with a macro that loops each of the 700 files, deletes the old macro and inserts the new macro.
Whoever creates the macro will need to know:
- the location of the 700 files
- the workbook name and module name containing the new macro
- the module name containing the old macro in the 700 files, and whether there are other macros in the same module.

Or perhaps you just want to change the sheet names in the 700 files without changing any macros?
I'm not clear as to what you need.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top