Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 22007

Searching for specific characters in listbox items?

$
0
0
Hi there everyone! I am working on a program where I a have a list of items.

The list is called YourList, and some of the items have specific letters in brackets like this (*).

I was wondering if I could modiify this code to search for just these. Because I might have a list of items such as

(*)item1
item2
item3
item4
item5

etc.

And if an item is found with that (*), then a msgbox would pop up with the name of just the item without the (*)

I would like to use this code, but am up for other options.

VB Code:
  1. Dim iczk As Integer
  2.    Dim srch_stringzk As String
  3.    srch_stringzk =  ""    'or whatever you want to search for ??This is where I am stuck, where do I code I just want to search for items with the (*) at the beginning?
  4.    For iczk = 0 To YourList.ListCount - 1
  5.       If YourList.List(iczk) = srch_stringzk Then
  6.          'msgbox = "Found"
  7.  
  8.       End If
  9.    Next iczk
Thank you for your help!!!

Viewing all articles
Browse latest Browse all 22007

Trending Articles