Userform Listbox selection does not go away

I have attached this flashcard application which asks for two responses for each question (in listboxes) and moves on only when both answers are correct.

When both answers are correct the list is cleared and repopulated but the last selection does not go away.

Please help me get rid of the listbox selection once the lists are repopulated.
Listbox-problem.xls
LVL 43
Saqib Husain, SyedEngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Either set both Listbox1.ListIndex and Listbox2.Listindex to -1 or unload and reload the userform
0
Saqib Husain, SyedEngineerAuthor Commented:
I had tried the -1 but to no avail.

How do I unload and reload the userform1?
0
Martin LissOlder than dirtCommented:
Unload
unload UserForm1

Load
UserForm1.Show <mode>

Where "Mode" is vbModal or vbModeless.

I believe vbModal is the default.
When a UserForm is modal, the user must supply information or close the UserForm before using any other part of the application. No subsequent code is executed until the UserForm is hidden or unloaded.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Saurabh Singh TeotiaCommented:
Saqib,

If i do this in your new word code..

ListBox2.ListIndex = -1

Open in new window


For me it don't select anything anymore in the listbox2..Now i'm not sure what you are trying to do here.. but it didnt had anything selected their..

Also i will change your newword which is called by userform activate to userform initialize.. so that it calls only when it loads otherwise dont call it everytime i select the userform or it becomes active..

Saurabh...
0
Saqib Husain, SyedEngineerAuthor Commented:
This worked. Thanks
0
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.