UserForm

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,
 
G

Guest

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
 
G

Guest

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?
 
I

Ivan F Moala

something along these lines


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

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

-------------------
 
G

Guest

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!
 

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