Option Explicit
Public WithEvents txtB As MSForms.TextBox
Public WithEvents CmbX As MSForms.ComboBox
Public usf As Object
Dim cls() As New cmajuscule
Function initiate(ByRef uf As Object)
Dim i&, ctrl As Object
For Each ctrl In uf.Controls
i = i + 1: ReDim Preserve cls(1 To i)
Select Case TypeName(ctrl)
Case "TextBox"
Set cls(i).txtB = ctrl: Set cls(i).usf = uf
Case "ComboBox"
Set cls(i).CmbX = ctrl: Set cls(i).usf = uf
End Select
Next
End Function
Private Sub CmbX_Change()
CmbX.Value = UCase(CmbX.Value)
End Sub
Private Sub txtB_Change()
txtB.Value = UCase(txtB.Value)
End Sub