Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Mouse double-click to select listbox item and run userform

Excel 2007 and XP Pro:
I have a UserForm with several list boxes. Normally I select items from
relevant listboxes and press OK button to continue with the macro.
Can I do the same by just double-clicking on any item of any listbox in the
Form, that is, combining list item selection and pressing OK into one
double-click?

Regards,
Lemi


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Mouse double-click to select listbox item and run userform

There is no double-click event, but you could measure the time between 2
click events
or mouse-down events and make your own double-click.
How about triggering the action with a right mouse-down?

RBS


"Lemi" wrote in message
...
Excel 2007 and XP Pro:
I have a UserForm with several list boxes. Normally I select items from
relevant listboxes and press OK button to continue with the macro.
Can I do the same by just double-clicking on any item of any listbox in
the Form, that is, combining list item selection and pressing OK into one
double-click?

Regards,
Lemi


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Mouse double-click to select listbox item and run userform

Hi RBS,

Thank you. However I have just found out that there was double-click event.
See below:

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

UserForm1.Hide 'put here exactly whatever your OK button does

End Sub

It works..
Lemi

"RB Smissaert" wrote in message
...
There is no double-click event, but you could measure the time between 2
click events
or mouse-down events and make your own double-click.
How about triggering the action with a right mouse-down?

RBS


"Lemi" wrote in message
...
Excel 2007 and XP Pro:
I have a UserForm with several list boxes. Normally I select items from
relevant listboxes and press OK button to continue with the macro.
Can I do the same by just double-clicking on any item of any listbox in
the Form, that is, combining list item selection and pressing OK into one
double-click?

Regards,
Lemi




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Mouse double-click to select listbox item and run userform

Ah, yes it has! Nice and simple then.

RBS


"Lemi" wrote in message
...
Hi RBS,

Thank you. However I have just found out that there was double-click
event. See below:

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

UserForm1.Hide 'put here exactly whatever your OK button does

End Sub

It works..
Lemi

"RB Smissaert" wrote in message
...
There is no double-click event, but you could measure the time between 2
click events
or mouse-down events and make your own double-click.
How about triggering the action with a right mouse-down?

RBS


"Lemi" wrote in message
...
Excel 2007 and XP Pro:
I have a UserForm with several list boxes. Normally I select items from
relevant listboxes and press OK button to continue with the macro.
Can I do the same by just double-clicking on any item of any listbox in
the Form, that is, combining list item selection and pressing OK into
one double-click?

Regards,
Lemi





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
Double click item in Listbox to select item and close Listbox GusEvans Excel Programming 3 July 19th 07 12:36 PM
Need selected item from listbox after double click [email protected] Excel Programming 1 February 23rd 06 03:18 PM
I want open file for click double mouse I want open file for click double mouse New Users to Excel 1 July 17th 05 12:49 PM
Mouse Over Graph, Capture Information on Click(Double Click) Dean Hinson[_3_] Excel Programming 1 December 6th 04 04:49 AM
select row in userform listbox with right-click? RB Smissaert Excel Programming 3 August 17th 04 05:49 PM


All times are GMT +1. The time now is 09:58 AM.

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"