I am having trouble passing a variable between a Userform and Code contained within a sheet. I have built a workbook that is used by our training department for gathering and storing all data relevent to a class(attendance, scoring, Logins,etc.) One of the things I am doing is pulling data from the request form that IT uses to create NT logins. The problem is it only stores new employees. So, I may have to search more than one workbook to get all of the data for my class. I am using this data to Issue Login Sheets to each employee with thier account names so I don't have to explain verbally all of the different tool's Login formats.
What I have done is create a button on a sheet that starts the search process then launches a userform with a Yes/No Question. No Drops the form and returns execution to the Sheet's Sub If all of the Logins are found on the same sheet. I want the YES button to launch a different Sub within the Sheet's Code as well as hiding the form which searches all of the remaining forms for employees that may have started in a different class.
I have tried Setting a Global variable in the Form Code and Sheet code, as well as trying to catch the click but it is not passed back to the Sheet code. I have also tried initating the Sub from the form, but I get a SUB OR LABEL NOT DEFINED error. I am Using Excel 2k
From the Form:
Private Sub CommandButton1_Click()
UserForm2.Hide
CheckAllNames
End Sub
Private Sub CommandButton2_Click()
UserForm2.Hide
End Sub
What I have done is create a button on a sheet that starts the search process then launches a userform with a Yes/No Question. No Drops the form and returns execution to the Sheet's Sub If all of the Logins are found on the same sheet. I want the YES button to launch a different Sub within the Sheet's Code as well as hiding the form which searches all of the remaining forms for employees that may have started in a different class.
I have tried Setting a Global variable in the Form Code and Sheet code, as well as trying to catch the click but it is not passed back to the Sheet code. I have also tried initating the Sub from the form, but I get a SUB OR LABEL NOT DEFINED error. I am Using Excel 2k
From the Form:
Private Sub CommandButton1_Click()
UserForm2.Hide
CheckAllNames
End Sub
Private Sub CommandButton2_Click()
UserForm2.Hide
End Sub