Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2007

Tip: Looking for answers? Try searching our database.

listbox events

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jigs - 19 Jan 2007 05:26 GMT
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 - 19 Jan 2007 16:15 GMT
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

> hi ,
>  i have created list box dynamically in the sheet in each row.
[quoted text clipped - 5 lines]
> please suggest me something.
> jigs d

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.