Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default listbox events

hi ,
i have created list box dynamically in the sheet in each row.
now i wnat that rather then coding for each event of the list box, i
shd be able to handle one event for each list box...
is it possible ?
i have created list box on excel sheet not on form.

please suggest me something.
jigs d

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default listbox events

If you used a listbox from the Forms toolbar, you can assign the same macro to
each listbox.

If you used a listbox from the control toolbox toolbar, each listbox will have
its own event. But each of those events could call a common procedure.

Just pass it whatever you need.

Option Explicit
Private Sub ListBox1_Click()
Call CommonProc(Me.ListBox1)
End Sub
Private Sub ListBox2_Click()
Call CommonProc(Me.ListBox2)
End Sub
Sub CommonProc(myLB As msforms.ListBox)
MsgBox myLB.ListIndex
End Sub


jigs wrote:

hi ,
i have created list box dynamically in the sheet in each row.
now i wnat that rather then coding for each event of the list box, i
shd be able to handle one event for each list box...
is it possible ?
i have created list box on excel sheet not on form.

please suggest me something.
jigs d


--

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
do events? background events cereldine[_15_] Excel Programming 1 April 12th 06 01:06 PM
UserForm ListBox Events David Excel Programming 0 November 1st 05 01:56 PM
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) modjoe23 Excel Programming 3 August 18th 05 02:35 PM
Help with listbox control events TrendyProgrammer Excel Programming 3 July 11th 05 06:07 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


All times are GMT +1. The time now is 06:07 AM.

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"