Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default Application.SendKeys "%{down}"

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
Leith Ross
 
Posts: n/a
Default Application.SendKeys "%{down}"


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


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=546300

  #3   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Application.SendKeys "%{down}"

Do this:

ComboBox1.SetFocus
Application.SendKeys "%{down}"

  #4   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default Application.SendKeys "%{down}"

Thanks alot, works great

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"