Application.SendKeys "%{down}"

  • Thread starter Thread starter damorrison
  • Start date Start date
D

damorrison

I am trying to get a combobox in a userform to open when it is selected
but cann't get it to work, here's what I was thinking...


TextBox1.TabIndex = 1
TextBox2.TabIndex = 2
TextBox3.TabIndex = 3
TextBox4.TabIndex = 4
ComboBox1.TabIndex = 5
With ComboBox1
Application.SendKeys "%{down}"
End With
How can I get this to Work
 
Hello damorrison,

You need to place the drop down command in the ComboBox's Enter Event.
Double click the ComboBox on the UserForm. This will bring up the code
window for the default event. In this case it is the Change Event. At
the Top Right of the code window, you should see the word Change. Click
the down arrow to see the other events. Scroll down to Enter in the list
and click it. The editor should insert the following in the code
window...

Private Sub ComboBox1_Enter()

End Sub


Insert the following in between the above lines to trigger the Drop
Down when the ComboBox is Selected...

Application.SendKeys "^{F4}"

Your code should look like this...

Private Sub ComboBox1_Enter()

Application.SendKeys "^{F4}"

End Sub

Sincerely,
Leith Ross
 

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