So I need help finishing up a app lookup on elements from the periodic table. The idea if to have the user input the element in the combo box in Userform1 which has a drop down list. To then depending on the element chosen be directed to Userform2 that has a text box, and in that text box be given the atomic mass for each element . I need an example of how and where to write the code in either userfroms. This is what i have so far.
UserForm1 name is Element_LookUp
Userform2 Name is Element_LookUp_Result
Userform1 :
Private Sub CommandButton1_Click()
Unload Me 'Closes The Screen after the click
Element_LookUp_Result.Show 'Shows The result scrren in a new pop up
End Sub
Private Sub UserForm_Initialize()
' All 118 Elements will be shown on a drop down list
' The elements are in order ; autofill helps input the element.
ComboBox1.AddItem "Hydrogen"
ComboBox1.AddItem "Helium"
ComboBox1.AddItem "Lithium"
ComboBox1.AddItem "Beryllium"
ComboBox1.AddItem "Boron"
ComboBox1.AddItem "Carbon"
End Sub ' Not all the elements are listed below i just wanted to save time
UserForm 2 :
Private Sub UserForm_Terminate()
Unload Me 'Once the (X) is clicked the result screen goes away
Element_Lookup.Show 'Result scrren goes back to the input screen again
End Sub