Find code module based on sheet name

svjensen

Board Regular
Joined
Jun 10, 2009
Messages
118
I need to use VBA to loop through all sheets in a given workbook, and modify a specific procedure in some of them.
The modification script is working fine, and I can identify the sheets easily.
But once I have identified the sheet I then need to get the name of the associated code module.

As I understand it, the code module keeps its original name (i.e. 'Sheet1') even though the sheet itself is renamed. But can I somehow extract that? Or find it in any other way?

/Soren
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,181,452
Messages
5,929,988
Members
436,714
Latest member
Sandri60

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
Top