looping events
Good day members! Is there a way where I can loop events? Say:
Public Sub textBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
'Do something
End Sub
Public Sub textBox2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
'Do something
End Sub
Public Sub textBox3_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
'Do something
End Sub
..... and so on.
What if I have 50 textbox objects, and I need to act on key press entry, is there a way where I don't have to enter these 50 events?
Example:
Public Sub Me.Controls(textBox(i))_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
'Do something
End Sub
Is there such thing? Thanks for your help!
|