Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Identify which List Box was used

I use the same code connected to several List Boxes. I need the code to
determine which List Box was used to trigger the code. Not sure how I capture
that ListBox name.
Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Identify which List Box was used


Private Sub ListBox1_Click()

Set bx = ActiveSheet.OLEObjects("Listbox1")
Call CommonBox(bx)
End Sub
Private Sub ListBox2_Click()

Set bx = ActiveSheet.OLEObjects("Listbox2")
Call CommonBox(bx)
End Sub

Sub CommonBox(bx)

'enter code here
End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=148748

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Identify which List Box was used

If you used listboxes from the control toolbox toolbar, then you should know
what one triggered the code.

If you used listboxes from the Forms toolbar, then you could use:

Dim LB As ListBox
Set LB = ActiveSheet.ListBoxes(Application.Caller)
MsgBox LB.Name & vbLf & LB.TopLeftCell.Address

These are listboxes placed on the worksheet, right?

jjb wrote:

I use the same code connected to several List Boxes. I need the code to
determine which List Box was used to trigger the code. Not sure how I capture
that ListBox name.
Thanks,


--

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
Identify Duplicates in a List BStacy Excel Discussion (Misc queries) 1 April 16th 09 07:20 PM
identify list used in a cell Don Excel Discussion (Misc queries) 2 May 28th 08 11:57 PM
how to identify unique list of 200 random entries from a list of 3 tjb Excel Worksheet Functions 3 August 13th 07 02:15 PM
Identify & List unique values from a list using functions/formulas momtoaj Excel Worksheet Functions 3 May 31st 07 06:18 PM
Identify last item in a list Greg Excel Discussion (Misc queries) 6 March 16th 05 11:47 PM


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