List Box Control problem

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
2,144
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hello All

I think i may have backed myself into a bit of a corner, and before ripping apart and starting again i thought best to check.

How would i return the row number of the listbox i double clicked without running a for loop to check, thing is, i may have already checked some boxes as i work down the list.

thanks

Dave
 
Probably
VBA Code:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    MsgBox Me.ListBox1.ListIndex
End Sub
The list is numbered from 0.

Artik
 
Upvote 0
Solution
Probably
VBA Code:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    MsgBox Me.ListBox1.ListIndex
End Sub
The list is numbered from 0.

Artik
Thanks so much, perfect, worked great.

Dave
 
Upvote 0
SQUIDD,

Please Note: In the future, when marking a post as the solution, please mark the post that contains the solution (not your own post acknowledging that some other post was the solution).
When a post is marked as the solution, it is then shown right underneath the original question so people viewing the question can easily see the question and solution in a single quick glance without having to hunt through all the posts.

I have updated this thread for you.
 
Upvote 0
Hi Joe

Sorry about that, i must have clicked the wrong one in error.

Honest mistake.

Thanks for correcting.

Dave
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top