ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UserForm (https://www.excelbanter.com/excel-programming/334694-userform.html)

Steve

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


drhalter

UserForm
 
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

"Steve" wrote:

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

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


"drhalter" wrote:

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

"Steve" wrote:

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,


Ivan F Moala[_62_]

UserForm
 

something along these lines


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

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

-------------------

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=38763


Steve

UserForm
 
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!

"Ivan F Moala" wrote:


something along these lines


Code:
--------------------

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

--------------------


--
Ivan F Moala


------------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
View this thread: http://www.excelforum.com/showthread...hreadid=387631




All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com