???Set cursor away from combobox

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

Guest

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.
 
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
 
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
 

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

Back
Top