View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal Robert Crandal is offline
external usenet poster
 
Posts: 309
Default Set focus on controls of modeless form

When I initially load my modeless form, the input focus
usually begins on my first textbox control (or any other
control).

However, if you click on the spreadsheet, then click
back to the modeless control, the input focus is lost
(ie. not set on any control). How can I set the
input focus back on Textbox1 if someone clicks on
the spreadsheet and then clicks back to the modeless form???

I already tried the following code, but it doesnt work:

Private Sub UserForm_Activate()
UserForm1.TextBox1.SetFocus
End Sub