ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   trigger event on userform focus (https://www.excelbanter.com/excel-programming/377158-trigger-event-userform-focus.html)

Jacob

trigger event on userform focus
 
is it possible to trigger an event when a userform is brought into
focus?


Susan

trigger event on userform focus
 
i tried:

Sub openuserform()

Load UserForm1
UserForm1.Show

End Sub
xxxxxxxxxxxxxxxxxx
Sub openuserform_change()

With Range("b5")
.Interior.ColorIndex = 6
.RowHeight = 25
.ColumnWidth = 10
End With

End Sub
xxxxxxxxxxxxxxxx
and it didn't work.
but when i added

Sub openuserform()

Load UserForm1
***Call openuserform_change***
UserForm1.Show

End Sub
xxxxxxxxxxxxxxxxxx
(take out astericks) then it worked. but you have to put it between
Load & show...... otherwise it doesn't do it until after you UNload the
userform.
there may be a better way to do it, i'm no guru!
susan


Jacob wrote:
is it possible to trigger an event when a userform is brought into
focus?



NickHK

trigger event on userform focus
 
Jacob,
You have the event :

Private Sub UserForm_Activate()

End Sub

NickHK

"Jacob" wrote in message
oups.com...
is it possible to trigger an event when a userform is brought into
focus?




Jacob

trigger event on userform focus
 
I wasn't sure if the activate sub work for just a change in focus.
thanks

On Nov 9, 9:24 pm, "NickHK" wrote:
Jacob,
You have the event :

Private Sub UserForm_Activate()

End Sub

NickHK

"Jacob" wrote in ooglegroups.com...

is it possible to trigger an event when a userform is brought into
focus?




All times are GMT +1. The time now is 10:38 AM.

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