ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using txtMy_GotFocus or txtMy_LostFocus in MSWord or Excel (https://www.excelbanter.com/excel-programming/373656-using-txtmy_gotfocus-txtmy_lostfocus-msword-excel.html)

Jonno

Using txtMy_GotFocus or txtMy_LostFocus in MSWord or Excel
 
Hello,

Is there some limitation to using the _GotFocus or _LostFocus in Word or
Excel forms?

I've used these extensively in Access, but now find myself stymied in my
Excel App...

Any help is appreciated,

Jonno



Tom Ogilvy

Using txtMy_GotFocus or txtMy_LostFocus in MSWord or Excel
 
With regard to Excel:

If you mean using MSForms 2.0 controls on a worksheet, then there is not
limitation. If you mean usingt them on a userform, then the limitation would
be that these events don't exist. Substitute events would be Enter and Exit
events.

--
Regards,
Tom Ogilvy


"jonno" wrote:

Hello,

Is there some limitation to using the _GotFocus or _LostFocus in Word or
Excel forms?

I've used these extensively in Access, but now find myself stymied in my
Excel App...

Any help is appreciated,

Jonno



Jonno

Using txtMy_GotFocus or txtMy_LostFocus in MSWord or Excel
 
OK. Basically then; use "_Enter" in place of "_GotFocus" and use "_Exit
(ByVal...." in place of "_LostFocus".

Easy enough - Thanks!

Jon

"Tom Ogilvy" wrote:

With regard to Excel:

If you mean using MSForms 2.0 controls on a worksheet, then there is not
limitation. If you mean usingt them on a userform, then the limitation would
be that these events don't exist. Substitute events would be Enter and Exit
events.

--
Regards,
Tom Ogilvy


"jonno" wrote:

Hello,

Is there some limitation to using the _GotFocus or _LostFocus in Word or
Excel forms?

I've used these extensively in Access, but now find myself stymied in my
Excel App...

Any help is appreciated,

Jonno



Tom Ogilvy

Using txtMy_GotFocus or txtMy_LostFocus in MSWord or Excel
 
Private Sub TextBox1_Enter()

End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)

End Sub

always best to select events from the dropdowns at the top of the userform
code module to insure arguments are declared correctly.

--
Regards,
Tom Ogilvy


"jonno" wrote:

OK. Basically then; use "_Enter" in place of "_GotFocus" and use "_Exit
(ByVal...." in place of "_LostFocus".

Easy enough - Thanks!

Jon

"Tom Ogilvy" wrote:

With regard to Excel:

If you mean using MSForms 2.0 controls on a worksheet, then there is not
limitation. If you mean usingt them on a userform, then the limitation would
be that these events don't exist. Substitute events would be Enter and Exit
events.

--
Regards,
Tom Ogilvy


"jonno" wrote:

Hello,

Is there some limitation to using the _GotFocus or _LostFocus in Word or
Excel forms?

I've used these extensively in Access, but now find myself stymied in my
Excel App...

Any help is appreciated,

Jonno




All times are GMT +1. The time now is 06:39 PM.

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