Solo Item In ListBox Not Selectable?

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a listbox in my userform. Its set us as a single selection. When the user clicks on it, they complete som data manipulation, and then the selection is eliminated from the listbox.

I have run into a problem. As the selections are removed one by one, eventually there is one left. It gets highlighted after the second last selection is removed. But clicking on this sole highlighted entry doesn't do anything anymore since clicking is no longer selecting the item as it's already selected.

What can I do to make this final listbox item clickable?

This is the code I am using to remove the item from the listbox.

Code:
        With test_mr.miss_rn
            If .ListIndex >= 0 Then
                .RemoveItem .ListIndex
            End If
        End With
 
Last edited:

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
The first item in the list has an index =0 . I believe you are assuming it is = 1.
 
Upvote 0

Forum statistics

Threads
1,216,730
Messages
6,132,387
Members
449,725
Latest member
Enero1

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