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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,215,045
Messages
6,122,830
Members
449,096
Latest member
Erald

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