ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ???Set cursor away from combobox (https://www.excelbanter.com/excel-programming/352148-set-cursor-away-combobox.html)

Jaylin

???Set cursor away from combobox
 
I have created a userform with a combo box that will popup on file opened.

I would like the curosr automaticall placed on the excel worksheet (eg CELL
A12) instead of the combo box.

Woudl appreciate some wise advice on how to do it.
--
Thanks a million for your time and expert advice :-)
Jaylin
*****Jaylin Message ended*******

[email protected]

???Set cursor away from combobox
 
Hi Jaylin

Do you mean cell pointer not mouse cursor?
Excel VBA is not able to move the mouse cursor on the specific
location.
But API functions may be able to do that.
I can't imagine on it.
Please google mouse-related C API functions

Best regards
sjoo


Giles[_2_]

???Set cursor away from combobox
 
Set the showmodal property of the UDF to be false - this allows the form to
remain on the screen whilst focus can be returned to the worksheet (i.e. the
form does not have to be closed to allow the cursor/user to work on the
worksheet).

Then, in the workbook_open module - after you've loaded the form - set the
cell range back to a cell on the sheet

e.g.

private sub Workbook_open
yourform.show <-- with property set to modeless
cells(1,1).select
end sub

Another way to do this is to simply use the vbModeless switch on the
form.show line
e.g.
yourform.show vbModeless

HTH
Giles


"Jaylin" wrote:

I have created a userform with a combo box that will popup on file opened.

I would like the curosr automaticall placed on the excel worksheet (eg CELL
A12) instead of the combo box.

Woudl appreciate some wise advice on how to do it.
--
Thanks a million for your time and expert advice :-)
Jaylin
*****Jaylin Message ended*******



All times are GMT +1. The time now is 11:39 PM.

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