Set previously selected item as selected in ListBox

whitehawk81

Board Regular
Joined
Sep 4, 2016
Messages
66
Hi, I haven't posted here for while. But unfortunately I'm facing an issue with a userform listbox selection change, that exceeds my knowledge.
The goal, I would like to achieve is following:
There is a multicolumn single select listbox, where the selection populates some textboxes based on the selected data.
You can select any row and the fields get updated accordingly, but changing a value in a textbox gets detected and if you click to another list item, you will be prompted if you would like to keep the changes or abandon them.
In case you select to keep the changes, the listbox should be reset to the previously selected item.
No matter, which method I try, the selected item in the listbox will not reset to the previous selection, it remains the currently selected.
 
Well, click event needs a click :) and iirc the listbox doesn't actually change when you select another row. I remember facing something similar, and will have to look for it. Anyway, good to know it got sorted.
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,224,833
Messages
6,181,242
Members
453,026
Latest member
cknader

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