Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thats what I was looking for thanks for you help Vergel
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code to search and display results in multicolumn listbox | Excel Programming | |||
Listbox Search Function | Excel Programming | |||
Listbox value return from search | Excel Programming | |||
Fill values into a listbox matching selected values from a combobox | Excel Programming | |||
Sorting ListBox results or transposing ListBox values to other cells for sorting | Excel Programming |