VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



InStr for lists

by Ridium (3 Submissions)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

will search a listbox's contents for a string returning a True if the string exists and a False if it dosent

Inputs
lst = The Listbox zString = The string to search the list for
Code Returns
True or False depending on if the string was found

Rate InStr for lists

Function ListIsIn(lst As ListBox, zString As String) As Boolean
On Error Resume Next
For i = 0 To lst.ListCount
  If lst.List(i) = zString Then ListIsIn = True: GoTo grr
Next i
ListIsIn = False
grr:
End Function

Download this snippet    Add to My Saved Code

InStr for lists Comments

No comments have been posted about InStr for lists. Why not be the first to post a comment about InStr for lists.

Post your comment

Subject:
Message:
0/1000 characters