Hello Forum,
I am working on designing a chemical inventory using Excel and VBA. One of the functions within the spreadsheet is to "inquire" about a chemical which emails a respective group's outlook distribution list based on the chemical record's details.
My problem arises from the inherit limitation of not being able to share a macro enabled document. My work around for this problem was to create multiple chemical inventories (~13, one for each laboratory group) and have each record export a *.csv file to a shared location when a save event is triggered. When determined necessary, a "site-wide" chemical inventory can be "refreshed" which compiles all the various saved *.csv files into their workbook for a "master" view.
The piece that I see giving some issue is updating the code of ~13 or so excel files when a small change occurs. More specifically, this section in the code is likely to change from time to time:
If Group = "160N-517" Then TeamName = "Biophysical Characterization and MS-S Inorganics"
If Group = "175" Then TeamName = "QCCA"
If Group = "120N" Then TeamName = "Bio"
If Group = "160N-417" Then TeamName = "Extractable and Leachable"
If Group = "140" Then TeamName = "Pulmonary and Nasal"
If Group = "140" Then TeamName = "Metals"
If Group = "160N-317" Then TeamName = "Stability"
If Group = "160N-220" Then TeamName = "Stability"
If Group = "160N-318" Then TeamName = "Stability"
If Group = "160N-518" Then TeamName = "Stability"
If Group = "160N-218" Then TeamName = "Product Venture Group"
If Group = "160S-230" Then TeamName = "Sterile Analytical or Analytical Research and Development"
If Group = "160N-517" Then Blaster = "G-ST-RTP-Inventory-BPC-MS-S"
If Group = "175" Then Blaster = "G-ST-RTP-Inventory-QCCA"
If Group = "120N" Then Blaster = "G-ST-RTP-Inventory-Bio"
If Group = "160N-417" Then Blaster = "G-ST-RTP-Inventory-EL"
If Group = "140" Then Blaster = "G-ST-RTP-Inventory-PN"
If Group = "140" Then Blaster = "G-ST-RTP-Inventory-Metals"
If Group = "160N-317" Then Blaster = "G-ST-RTP-Inventory-Stability-1"
If Group = "160N-220" Then Blaster = "G-ST-RTP-Inventory-Stability-1"
If Group = "160N-318" Then Blaster = "G-ST-RTP-Inventory-Stability-2"
If Group = "160N-518" Then Blaster = "G-ST-RTP-Inventory-Stability-2"
If Group = "160N-218" Then Blaster = ""
If Group = "160S-230" Then Blaster = "G-ST-RTP-Inventory-Analytical"
What is the best way to handle changing this data? My recent idea is to create a text file or xml file and paste in the variables there. I would then call the *.txt or *.xml (or what is best) to have the code update those variables. Any suggestions?
Bookmarks