how to modify the code so that when i select the name from the listbox the listbox should hide.

Flora Edwards
Flora Edwards used Ask the Experts™
Martin helped me with question i had how to do this Excel search box Soundex Search.

attached is the solution.

when i click a name from the listbox it should hide the listbox and if i click again in the textbox to search for new value the listbox should show.

how can i make this toggle work?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
To the sheet2 module Add
Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
ActiveSheet.ListBoxes("List Box 2").Visible = True
End Sub

Open in new window

and in the Sub ListBox2_Change() add at the end
ActiveSheet.ListBoxes("List Box 2").Visible = False

Open in new window

Flora EdwardsMedicine


thank you very much Saqib. perfect solution.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial