ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   updating userform (https://www.excelbanter.com/excel-programming/406686-updating-userform.html)

Steve

updating userform
 
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

Rick Rothstein \(MVP - VB\)[_1343_]

updating userform
 
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


"steve" wrote in message
...
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



JLGWhiz

updating userform
 
Maybe start he

http://www.excel-vba.com/excel-vba-contents.htm

"steve" wrote:

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



All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com