Advance programatically to the next item in a listbox

svjack9

New Member
Joined
Feb 9, 2014
Messages
32
I have a form with a listbox that displays items which need some kind of action. Once that action is completed the result is pasted to a cell in an underlying worksheet. I would like the listbox to automatically advance to the next item in its list instead of my having to physically click on the next item. Is there a way to do that?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try this method

VBA Code:
    Dim x As Long
    For x = 0 To ListBox1.ListCount - 2
      If ListBox1.Selected(x) = True Then
        ListBox1.Selected(x + 1) = True
        Exit For
      End If
   Next x
 
Upvote 0
If it's a single select listbox, you can just increment the Listindex property by 1.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

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