Not sure where you want to go with this but .Parent will give you the control's parent, which in MOST cases will be the UserForm.
You might have to get the grand .Parent depending but the process is the same
Option Explicit
'Inside the class module
Private m_PassedControl As MSForms.Control
Private WithEvents chk As MSForms.CheckBox
Private WithEvents cbo As MSForms.ComboBox
Private WithEvents lst As MSForms.ListBox
Private WithEvents opt As MSForms.OptionButton
Private WithEvents spn As MSForms.SpinButton
Private WithEvents txt As MSForms.TextBox
Property Get frmName() As String
frmName = m_PassedControl.Parent.Name
End Property
Property Set ctl(PassedControl As MSForms.Control)
Set m_PassedControl = PassedControl
Select Case TypeName(PassedControl)
Case "CheckBox"
Set chk = PassedControl
Case "ComboBox"
Set cbo = PassedControl
Case "ListBox"
Set lst = PassedControl
Case "OptionButton"
Set opt = PassedControl
Case "SpinButton"
Set spn = PassedControl
Case "TextBox"
Set txt = PassedControl
End Select
End Property
Private Sub cbo_Change()
PrintControlName
End Sub
Private Sub chk_Click()
PrintControlName
End Sub
Private Sub lst_Change()
PrintControlName
End Sub
Private Sub opt_Click()
PrintControlName
End Sub
Private Sub spn_Change()
PrintControlName
End Sub
Private Sub txt_Change()
PrintControlName
End Sub
Sub PrintControlName()
Select Case frmName
Case "UserForm1"
Debug.Print "Hello from UserForm1 --- ", m_PassedControl.Name
Case "UserForm2"
Debug.Print "Goodbye from UserForm2 --- ", m_PassedControl.Name
End Select
End Sub
Hello from UserForm1 --- CheckBox2
Hello from UserForm1 --- CheckBox1
Goodbye from UserForm2 --- OptionButton1
Goodbye from UserForm2 --- CheckBox1
Goodbye from UserForm2 --- CheckBox1
HOWEVER, I personally don't think it's a good OOP idea to include such specific logic in an object. I'd look for a way to keep the object non-specific and have the calling procedure handle specific tasks