Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 8
Default VBA Combobox "Enter"

Hi,

I'm trying to program VBA to hit the "Enter" key in a Combo Box, but I don't remember the proper code. Here is what I have:

Application.Shapes("ComboBox1") = True

Can anyone help me out?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default VBA Combobox "Enter"

Hi,

I'm trying to program VBA to hit the "Enter" key in a Combo Box, but
I don't remember the proper code. Here is what I have:

Application.Shapes("ComboBox1") = True

Can anyone help me out?

Thanks!


A Combobox triggers via its _Change event. You need to change its
content to the text item that you want it to display. The text items
are its list, and so you must use one of these or enter new text you
want to add to its list. The needed code depends on which control (Form
or ActiveX) you're working with.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Combobox "Enter"

If it's an ActiveX combobox then catch Enter in its Keydown event like this:

Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
KeyCode = 0 'cancel the keystroke
MsgBox "Entered!" 'do something custom
End If
End Sub

Ths Forms combos don't have events like this.

HTH. Best wishes Harald


"arceaf" skrev i melding
...

Hi,

I'm trying to program VBA to hit the "Enter" key in a Combo Box, but I
don't remember the proper code. Here is what I have:

Application.Shapes("ComboBox1") = True

Can anyone help me out?

Thanks!




--
arceaf



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
command button and the "enter" and "tab" keys dr chuck Excel Programming 10 September 11th 06 12:09 AM
Make "Edit" mode default, rather than "Enter"? Greg Boettcher Excel Discussion (Misc queries) 1 July 27th 06 01:46 AM
Combobox: Make "Enter" = Select brucemc[_26_] Excel Programming 2 July 6th 06 10:52 PM
"enter" event of activex combobox? crapit Excel Programming 11 July 13th 04 11:59 AM


All times are GMT +1. The time now is 05:45 PM.

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

About Us

"It's about Microsoft Excel"