Multiple Modules vs Sub-Procedures in a single Module

bprisk

New Member
Joined
Feb 4, 2011
Messages
22
I've got - in my humble opinion - a wonderful macro that I've developed with lots of searching and learning from this site. All of the code resides in "Module1" in a number of sub-procedures. I've seen other folks develop their code using multiple modules with essentially one sub-procedure in each module. Is there a benefit to either approach? Is there a "best practice" method? Or is it just personal preference?

I'm getting ready to dive into combining code in Access with some of the procedures I built into the Excel code, and would like to make the "new" program cleaner.

Thanks!

Brad
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
It can make sense to group related macros in one module for clarity or because you can then copy the module to another workbook and have all those related macros together.
Another consideration is that some declarations you make at the start of your macros can be limited in scope to just the current module or public to all modules. When you make a declaration, the scope can also be on a macro-only level.

I wonder what others will say.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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