![]() |
Search Listbox Values
I have a TextBox and a ListBox. My question is Is there a way to
search through the values in the listbox to see if the value entered in the textbox exists in the Listbox? |
Search Listbox Values
here's one way:
Sub test() Dim i As Integer For i = 0 To ListBox1.ListCount - 1 If TextBox1.Text = ListBox1.List(i) Then MsgBox TextBox1.Text & " exists in listbox" Exit Sub End If Next i MsgBox TextBox1.Text & " does not exist in listbox" End Sub -- Hope that helps. Vergel Adriano " wrote: I have a TextBox and a ListBox. My question is Is there a way to search through the values in the listbox to see if the value entered in the textbox exists in the Listbox? |
Search Listbox Values
Thats what I was looking for thanks for you help Vergel
|
All times are GMT +1. The time now is 12:21 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com