Userform listbox - change event

Formula11

Active Member
Joined
Mar 1, 2005
Messages
477
Office Version
  1. 365
Platform
  1. Windows
How can a change event be captured in a list box, when you re-select the same item.

In this case, there are 2 list boxes.
1. After selecting an item in the first listbox, there is a change event. OK.
2. Then select an item in the second listbox, there is a change event. OK.
3. If I go back to the first, select the same item, there is no change event.

How can 3. be solved?

1677393133828.png



VBA Code:
Private Sub ListBox1_Change()
    MsgBox "changed 1"
End Sub

Private Sub ListBox2_Change()
    MsgBox "changed 2"
End Sub
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Use click event instead (or also)? If you re-select the same selected item, there is no change.
 
Upvote 0
Thanks, but the click event didn't work.
I'll look into it further.
 
Upvote 0
Both the Change and the Click event of a Listbox requrie a new item to be selected. One workaround that will react to an item being selected again would be to use the MouseUP event.
 
Upvote 0
Solution

Forum statistics

Threads
1,225,740
Messages
6,186,759
Members
453,370
Latest member
juliewar

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