Hay que crear una clase.
Instrucciones para crear una clase
1. Abre tu hoja de excel
2. Para abrir Vba-macros y poder pegar la macro, Presiona Alt + F11
3. En el menú elige Insertar / Módulo de clase
4. En el panel del lado derecho copia la macro
Option Explicit
Public WithEvents tbxCustom1 As MSForms.TextBox 'Custom Textbox
'Referencia
'http://www.ozgrid.com/forum/showthread.php?t=80631
Private Sub tbxCustom1_Change()
'Message Box To Display Which Textbox Was Changed
'MsgBox "You added A Number To: " & tbxCustom1.Name
'This is just to show you can handle multiple events of the textbox
End Sub
Private Sub tbxCustom1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Dim n As Integer
'Allow only Numbers To be Entered Into Textbox
n = KeyAscii
Select Case KeyAscii
Case 46 To 57 'números (./0123456789)
Case Else
KeyAscii = 0
End Select
End Sub
Private Sub Class_Terminate()
'Destroy The Class Object And Free Up Memory
Set tbxCustom1 = Nothing
End Sub
Ahora en tu formulario copia esto
Dim colTbxs As Collection 'Collection Of Custom Textboxes
Private Sub UserForm_Initialize()
Dim ctlLoop As MSForms.Control
Dim clsObject As clsObjHandler
'Create New Collection To Store Custom Textboxes
Set colTbxs = New Collection
'Loop Through Controls On Userform
For Each ctlLoop In Me.Controls
'Check If Control Is A Textbox
If TypeOf ctlLoop Is MSForms.TextBox Then
'Create A New Instance Of The Event Handler CLass
Set clsObject = New clsObjHandler
'Set The New Instance To Handle The Events Of Our Textbox
Set clsObject.tbxCustom1 = ctlLoop
'Add The Event Handler To Our Collection
colTbxs.Add clsObject
End If
Next ctlLoop
End Sub
Private Sub UserForm_Terminate()
'Destroy The Collection To Free Memory
Set colTbxs = Nothing
End Sub
Saludos.DAM
Si es lo que necesitas.