vba code to change vba code

alexaronson

Active Member
Joined
Sep 30, 2005
Messages
314
Hello and thanks for looking at my question.

I have a master work sheet with code that defines the workbook. For instance, I have
Code:
Dim masterWB as Workbook

Set masterWB = Workbooks("BLAH.xlsm")

My master workbook now needs to have various versions made so that I now have "Blah1.xlsm", "Blah2.xlsm", etc.

How can I run a macro that would change all the macro's within "Blah1.xlsm" so that Set masterWB = Workbooks("BLAH.xlsm") now = "Blah1.xlsm"

Thanks
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try a FIND/REPLACE and have it look at the project.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,758
Members
452,940
Latest member
rootytrip

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