Focus Event

N

Nigel

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
 
E

excelent

doubleclick on userform and insert

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


"Nigel" skrev:
 
N

Nigel

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.
 
J

Jim Thomlinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top