Select Row in Listbox based on Value in Cell

Hi everyone,

I want to be able to open a window that i have already created that contains a listbox that is populated with information. when the window is opened i want it to highlight the a row based on the value i push to the window.

Example:
Listbox contains:
Col0 |Col1 |Col2
…0 | Test0 |Test0
…1 | Test1 | Test1
…2 | Test2 | Test2
Now i want to highlight the row that contains ‘1’ in Col0
Is there a way to do this?

Also if someone has a better name for this conversation that would be easier for other people to find i will gladly change it.

dim myword as string = "test" // replace with your word for row as integer = 0 to ListBox1.ListCount-1 for column as Integer = 0 to ListBox1.ColumnCount-1 if ListBox1.Cell(row, column) = myword Then ListBox1.ListIndex = row ListBox1.ScrollPosition = ListBox1.ListIndex exit for row End If next next

for column 0

dim myword as string = "1" for row as integer = 0 to ListBox1.ListCount-1 if instr(ListBox1.Cell(row, 0), myword) > 0 Then ListBox1.ListIndex = row ListBox1.ScrollPosition = ListBox1.ListIndex exit for row End If next

Thank you so much