View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Set focus on controls of modeless form

I don't know the answer to that one Robert. I think that Excel is missing
something here and it should work.

--
Regards,

OssieMac


"Robert Crandal" wrote:

Hi OssieMac,

The code below works, but it assumes that the user will click somewhere
WITHIN the userform. If the user clicks on the top title bar to
re-activate the userform that code will not work.

How can I detect if the form is activated by a click on the top title
bar??


"OssieMac" wrote in message
...
Hi Robert,

I don't know why the following works. I suspect some kind of bug but use
the
userform click event and then set the focus to another control first then
to
the one you really want.

Private Sub UserForm_Click()
Me.TextBox2.SetFocus
Me.TextBox1.SetFocus
End Sub

--
Regards,

OssieMac


.