updating userform

S

steve

2 part question:

a. What events should I be using to update between my userform and
worksheet? Is it ever good practice to use the ControlSource property for
say a textbox?

b. How can I validate multiple textbox's with the same code? For example:
Private Sub TextBox1_Change()
Call Update
End Sub

Private Sub TextBox2_Change()
Call Update
End Sub

In Sub Update(), how do I reference which text box changed?

thanks,
Steve
 
R

Rick Rothstein \(MVP - VB\)

The ActiveControl object will always reference the control that is currently
active. Since your Sub is being called from a control's event procedure,
then that control must currently be active, so ActiveControl will be
referencing it.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top