Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm with ListBox
Excel 2002, WinXP
I have a UserForm with a ListBox and OK and Cancel buttons. I know how to deal with a selection in the ListBox when the user makes a selection and clicks the OK button. But sometime in the past I was able to induce code action with just the selection of an item (multi-select set to 1) in the ListBox. IOW, there was no OK button or a need for an OK button. How do I do that? Thanks for your help. Otto |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm with ListBox
Hi Otto,
You are looking for the "ListBox1_Click()" event or the "ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)" event. They are found in the form module. Regards, Jim Cone San Francisco, CA "Otto Moehrbach" wrote in message ... Excel 2002, WinXP I have a UserForm with a ListBox and OK and Cancel buttons. I know how to deal with a selection in the ListBox when the user makes a selection and clicks the OK button. But sometime in the past I was able to induce code action with just the selection of an item (multi-select set to 1) in the ListBox. IOW, there was no OK button or a need for an OK button. How do I do that? Thanks for your help. Otto |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm with ListBox
Otto,
You can use the Click event of the Listbox control to execute code with the user selects an item in the list. E.g., Private Sub ListBox1_Click() ' your code here End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Otto Moehrbach" wrote in message ... Excel 2002, WinXP I have a UserForm with a ListBox and OK and Cancel buttons. I know how to deal with a selection in the ListBox when the user makes a selection and clicks the OK button. But sometime in the past I was able to induce code action with just the selection of an item (multi-select set to 1) in the ListBox. IOW, there was no OK button or a need for an OK button. How do I do that? Thanks for your help. Otto |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm with ListBox
Jim, Chip
Thanks for that. I'll try it out. Otto "Otto Moehrbach" wrote in message ... Excel 2002, WinXP I have a UserForm with a ListBox and OK and Cancel buttons. I know how to deal with a selection in the ListBox when the user makes a selection and clicks the OK button. But sometime in the past I was able to induce code action with just the selection of an item (multi-select set to 1) in the ListBox. IOW, there was no OK button or a need for an OK button. How do I do that? Thanks for your help. Otto |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm with ListBox
Otto,
Jim's reply was better than mine. To replicate a button press, you should use the DoubleClick event not the Click event. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Otto Moehrbach" wrote in message ... Jim, Chip Thanks for that. I'll try it out. Otto "Otto Moehrbach" wrote in message ... Excel 2002, WinXP I have a UserForm with a ListBox and OK and Cancel buttons. I know how to deal with a selection in the ListBox when the user makes a selection and clicks the OK button. But sometime in the past I was able to induce code action with just the selection of an item (multi-select set to 1) in the ListBox. IOW, there was no OK button or a need for an OK button. How do I do that? Thanks for your help. Otto |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Listbox rowsource on Userform | Excel Discussion (Misc queries) | |||
Listbox in UserForm | Excel Discussion (Misc queries) | |||
???Help??? Userform.Listbox.rowsource = ??? | Excel Discussion (Misc queries) | |||
UserForm Listbox in VBC | Excel Discussion (Misc queries) | |||
UserForm ListBox | Excel Programming |