#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Focus Event

I have a userform that is loaded as modeless, so that the user can interact
with the underlying worksheet.

Question: Is there an event I can use / create that allows my code to detect
when the userform has focus?

Thanks

--
Cheers
Nigel




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Focus Event

doubleclick on userform and insert

Private Sub UserForm_Click()
MsgBox ("Got focus")
End Sub


"Nigel" skrev:

I have a userform that is loaded as modeless, so that the user can interact
with the underlying worksheet.

Question: Is there an event I can use / create that allows my code to detect
when the userform has focus?

Thanks

--
Cheers
Nigel





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Focus Event

Thanks for that, I understand that if the user clicks the userform I can
determine if the userform has focus.
What I need to be able to do is test, in code, if the userform has focus or
not - before the user clicks the userform.


--
Cheers
Nigel



"excelent" wrote in message
...
doubleclick on userform and insert

Private Sub UserForm_Click()
MsgBox ("Got focus")
End Sub


"Nigel" skrev:

I have a userform that is loaded as modeless, so that the user can
interact
with the underlying worksheet.

Question: Is there an event I can use / create that allows my code to
detect
when the userform has focus?

Thanks

--
Cheers
Nigel







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Focus Event

There really is nothing to tell you that the user form has focus. The click
event is close but if the user clicks on a button on the form instead of the
form itself then the userform gets focus without the userform_click event
firing. So basically you are on your own to come up with some sort of a
creative solution around your problem.
--
HTH...

Jim Thomlinson


"Nigel" wrote:

Thanks for that, I understand that if the user clicks the userform I can
determine if the userform has focus.
What I need to be able to do is test, in code, if the userform has focus or
not - before the user clicks the userform.


--
Cheers
Nigel



"excelent" wrote in message
...
doubleclick on userform and insert

Private Sub UserForm_Click()
MsgBox ("Got focus")
End Sub


"Nigel" skrev:

I have a userform that is loaded as modeless, so that the user can
interact
with the underlying worksheet.

Question: Is there an event I can use / create that allows my code to
detect
when the userform has focus?

Thanks

--
Cheers
Nigel








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to catch the event when an Excel window gets focus? Andrew Excel Programming 4 March 9th 07 05:20 AM
trigger event on userform focus Jacob Excel Programming 3 November 10th 06 01:03 PM
Excel Got FOcus event Xcelion Excel Programming 2 January 9th 06 03:20 PM
Is there a VBA Event to Detect Change in ActiveCell Focus? Larry A[_3_] Excel Programming 4 September 16th 05 03:23 AM
event which occurs when a TextBox receives focus Mikhail Excel Programming 2 October 7th 03 02:27 PM


All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"