Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run command when hitting ENTER on list box item

Hi.

I have a listbox with several items. If the users double click on an item, a
detail info form are retrieved for the current item. I want the same thing
to happen when the user click ENTER on a highlighted item in a list box

something like this:

Sub frm_mainList_KeyDown()
If application.onkey = {ENTER} THEN
frm_details.show
End if
End sub


Please clean up my code, somone.

Mr. Smith



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Run command when hitting ENTER on list box item

Couldn't you just use either/both of these:

Option Explicit
Private Sub ListBox1_Click()
MsgBox "Click"
End Sub
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
MsgBox "dclick"
End Sub



"Mr. Smith" wrote:

Hi.

I have a listbox with several items. If the users double click on an item, a
detail info form are retrieved for the current item. I want the same thing
to happen when the user click ENTER on a highlighted item in a list box

something like this:

Sub frm_mainList_KeyDown()
If application.onkey = {ENTER} THEN
frm_details.show
End if
End sub

Please clean up my code, somone.

Mr. Smith


--

Dave Peterson

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
value changes after hitting Tab or Enter button Jose Esteves Excel Discussion (Misc queries) 2 January 27th 10 08:59 PM
Cell changes to a formula after hitting ENTER PerryK Excel Discussion (Misc queries) 4 October 8th 08 05:14 PM
numbers appear different after hitting enter cb New Users to Excel 3 March 27th 08 10:46 PM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM
Insert new row after hitting enter Jeff[_23_] Excel Programming 2 October 15th 03 10:14 PM


All times are GMT +1. The time now is 07:48 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"