Multiple Excel Worksheets Sharing the same VB Code

MS-Excel-Rookie

New Member
Joined
Aug 6, 2010
Messages
3
The purpose of the Excel Spreadsheets is to contain the Formulas for creating the products that the company sells. Production Users will enter information such as Compound Names, Lot Numbers, and amounts (weights) of each compound that is to be used. The Spreadsheet has the appropriate formulas to do the proper checking, and VB Code that will verify that the Lot Number entered contains the appropriate compound.

The same VB Code is able to work for all of the Spreadsheets, since they all have the same relative structure (each row is formatted the same way, although not all of the Spreadsheets have the same number of rows). This will result in numerous Spreadsheets that all contain the same VB Code (over 20 so far, and over 1500 expected by the end of the project).

Is there any way for all of the Spreadsheets to share the VB Code? I can only imagine that Maintenance of the VB Code will be come a nightmare over time if each sheet requires its own copy.
<!-- / message --><!-- sig -->
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,028
Messages
5,856,932
Members
431,840
Latest member
simplysoph

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