checking if number in listbox

genu

Well-known member
Joined
Jun 9, 2005
Messages
94
Programming Experience
1-3
I have a listbox with phone numbers extracted from a website. but the list is populated with different characters that the program thinks that are potential phone numbers. the phone numbers in the list are in this format: "1231231234" how doI remove all the other items that dont have numberes in them?
 
Hi,

No idea if this helps, this will totally remove any items that do not evaluate to numbers.

dim lindex as integer

For lindex = (ListBox1.Items.Count -1) to 0 step -1
If Not IsNumeric(ListBox1.Items.Item(lindex)) Then

ListBox1.Items.RemoveAt(lindex)

End If

Next
 
Back
Top