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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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