Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Setting focus

  Asked By: Chloe    Date: Sep 05    Category: MS Office    Views: 801
  

I need to open a UserForm but give focus to the workbook, not to the
user form so that the user can continue entering data in the worksheet
without having to click on the workbook to set the focus back to the
workbook. Any suggestions?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Janis Hart     Answered On: Sep 05

A non-modal form  can reactivate the active cell. Just

Private Sub UserForm_Activate()
ActiveCell.Activate
End Sub

Seemingly meaningless code, but it does the job (in 2003 anyway).

The form will still be visible, but the sheet will have the focus.

 
Answer #2    Answered By: Shiv Patel     Answered On: Sep 05

After some experimentation this worked:

UserForm1.Show vbModeless '(vbmodeless not required if form's
ShowModal is set  to False)
AppActivate "Microsoft Excel"

 
Didn't find what you were looking for? Find more on Setting focus Or get search suggestion and latest updates.




Tagged: