Highlight 1 row in listbox per VBA

R

Robert

Hello
I want to highlight a row in one listbox per VBA code. I tried this
cat_I.Value containing the actual value (bound column):

List10.Selected(cat_I.Value) = False
List10.Selected(cat_I.Value - 1) = True
refresh

The value of list10 is now cat_I.Value - 1 but the highlighted row is still
cat_I.Value
Can anyone help me please
Thanks
 
R

Robert

hallo
thanks for the message, if i take away the refresh the list will not be
resorted
 
O

Ofer Cohen

In that case try running the refresh before setting the list box line number

List10.Requery
List10.Selected(cat_I.Value) = False
List10.Selected(cat_I.Value - 1) = True
 
Top