UserForm

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a UserForm with a drop box. The drop box has all of the worksheets in
the workbook, so when the user clicks the worksheet name, it will become the
active workbook on the screen. So far, so good.

After I drop down the drop box and select the worksheet name, I want the
active worksheet to have the focus, not the userform. However, the cursor
stays in the drop box and I have to manually click in the worksheet to get
the focus there. I have used ActiveSheet.Select, but the focus stays with
the userform drop box.

Any ideas.

Thanks,
 
Steve,

I think what you are looking for is the following command.

UserForm1.Hide

Add this at the point you want your sheet to become active, and you should
have no problem. Note that this command hides the form, but the form is
still running. You can then either show the form again (UserForm1.Show) or
end the form's operation (Unload UserForm1).

Dave
 
Thanks Dave.

I don't really want to hide the form, rather use it as a "toolbar" so that
the users can continue to use the drop box to get to different tabs. I just
want them to select a tab from the form, have that tab become the active
sheet, and have the focus be set to the sheet in the current cell. I want
the user form to stay open and available, but the cursor to be in the
spreadsheet. Make any sense?
 
something along these lines


Code
-------------------

Sheets(ComboBox1.Text).Activate
AppActivate "Microsoft Excel"

-------------------
 
Ivan,

Thank you, thank you. You have no idea how much this has helped. I can
stop pulling my hair out!

I greatly appreciate the help!
 
Back
Top