Using a macro to alter another macro

paulsolar

Well-known Member
Joined
Aug 21, 2013
Messages
684
Office Version
  1. 365
Hi All

I'm hoping this is possible, but doubt if it is.

I have a macro that works fine, it is for producing sales managers reports, the only problem is that if a sales manager leaves I have to alter the macro in several places which is a right pain for me.

The sales managers name us used as part of the sub title and in the body of the macro.

What I'd like to do ideally is have a separate worksheet, say called "change sales managers" and a user form where they enter the outgoing sales managers name and the name of the replacement sales manager. Then do a find and replace in the report generating macro. Currently I have to do this manually using find and replace. It doesn't take long but it always needs doing whist I'm away from the office.

Any ideas where to start would be appreciated and is it possible to change the name of a sub in another macro using a macro??

Many thanks in advance

Cheers

Paul
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You can use the macro recorder for find and replace to get the code, then edit it to clean it up.
 
Upvote 0

Forum statistics

Threads
1,215,309
Messages
6,124,180
Members
449,146
Latest member
el_gazar

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