Identify which List Box was used

  • Thread starter Thread starter jjb
  • Start date Start date
J

jjb

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,
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top