Obviously, we disagreealcorjr said:Well, the vba help is quite cryptic, as is often the case.
No, no one wrote that and neither does help indicate that. Try this test with XL2000 or later. It will make very explicit how the events work.alcorjr said:both initialize and activate events run whenever a control or object belonging to that userform is mentioned in other parts of the code.
Option Explicit
Private Sub UserForm_Activate()
MsgBox "In Userform1_Activate"
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Initialize()
MsgBox "In Userform1_Initialize"
End Sub
Option Explicit
Private Sub UserForm_Activate()
MsgBox "In Userform2_Activate"
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Initialize()
MsgBox "In Userform2_Initialize"
End Sub
Sub testIt()
Load UserForm1
Load UserForm2
UserForm1.Show vbModeless
Application.Wait Now() + TimeValue("0:0:3")
UserForm2.Show
End Sub
Go ahead and make us feel bad. {g} Sub-normal temperatures and super-normal precipitation for a record number of days!alcorjr said:Thanks a lot from sunny Costa Rica
You are welcome.alcorjr said:Tushar, thanks.
No. The Activate event triggers when the object is activated, i.e., becomes the active window. It is exactly as defined in the help file. Experiment for yourself using a testbed analogous to what I posted earlier.alcorjr said:The show command or any click on the userform itself will trigger the Activate event, and so will any reference to an object on the userform,
eg. ; na=Userform1.textbox1.value
Right??