I have a userform that requires input into various textboxes and comboboxes. The inputs are for measurements and have units associated with them. I want the userform to display which units are expected to be used when you click into each specific text/combobox.
Currently, my code works for textboxes but does not recognize comboboxes. Here is my code.
Private Sub TextboxActions_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If InStr(1, TextboxActions.Name, "OD") > 0 Then
UserForm1.inUnit.Visible = True
UserForm1.mmUnit.Visible = False
UserForm1.eaUnit.Visible = False
ElseIf InStr(1, TextboxActions.Name, "CE") > 0 Then
UserForm1.inUnit.Visible = False
UserForm1.mmUnit.Visible = True
UserForm1.eaUnit.Visible = False
Else
UserForm1.inUnit.Visible = False
UserForm1.mmUnit.Visible = False
UserForm1.eaUnit.Visible = True
End If
End Sub
Using this, when the user clicks a textbox it will display the units in, mm, or ea. I want this to be the case for comboboxes as well, but currently nothing happens when clicking into a combobox.

