I need to capture what is in the cell in row 8, and 1 column over from what matches the cboEN value... the cboEN value is determined from a name that the user selects from a dropdown box on a userform.
In the picture that I have as an example, if cboEN = "Bell, Don", then I need to capture (as the assigned ckEMP value shown in the code below) the contents that are in cell AE8... (which is the string "Oni")
My code for this is:
So what I am trying to make happen is if "Oni" appears in the cell, then a checkbox on the userform that assigned to that value (to the "Oni" value) becomes 'ticked' after the userform is populated based on the cboEN value (which in this case is "Bell, Don" in row 1 on the worksheet "Object2")
Lastly, DynamicRange covers a large area on the object2 worksheet beginning in Row 1... which is the row that contains the names that cboEN is matching up to. (hope that makes sense! )
Thanks for any help or assistance from anyone willing to help!
In the picture that I have as an example, if cboEN = "Bell, Don", then I need to capture (as the assigned ckEMP value shown in the code below) the contents that are in cell AE8... (which is the string "Oni")
My code for this is:
VBA Code:
Private Sub cboEN_Exit(ByVal Cancel As MSForms.ReturnBoolean)
' Locate EMPLOYEE NAME from ComboBox selection
Dim ckEMP As String
ckEMP = Application.WorksheetFunction.HLookup((Me.cboEN), Object2.Range("DynamicRange"), 8, 0)
If ckEMP = "Oni" Then .chkOninEMP1 = True Else
So what I am trying to make happen is if "Oni" appears in the cell, then a checkbox on the userform that assigned to that value (to the "Oni" value) becomes 'ticked' after the userform is populated based on the cboEN value (which in this case is "Bell, Don" in row 1 on the worksheet "Object2")
Lastly, DynamicRange covers a large area on the object2 worksheet beginning in Row 1... which is the row that contains the names that cboEN is matching up to. (hope that makes sense! )
Thanks for any help or assistance from anyone willing to help!