Auto Select ListBox Row

How do I (in code) select(highlight) a particular row in a ListBox?

For a single selection: Listbox,listindex = row

More generally particularly when multi-selection is enabled:
Listbox.Selected(row) = True

Thanks.

For some reason I though the “ListBox.ListIndex = Row” was for determining what row the user selected and couldn’t be used for selecting a row in code.

I tried the Listbox.Selected(Row) = True and was given an error.

Replace ListBox with the real name of YOUR ListBox.

I did that to begin with.

Post your code.

I got it sorted out with:

 Listbox.listindex = row

which does exactly what I need.

Thanks