Select Specific text on listbox

Hi,

I want to change the content of the text of the listbox with criteria,

dim x,h as string dim o as integer for o = 0 to Listbox1.ListCount - 1 x=Listbox1.Cell(o,1) x=x.Left(2) h=Listbox1.Cell(o,4) if x ="FD" and h="0" then dim dd as Integer for dd=ListBox1.Listcount downto 0 if ListBox1.selected(dd) then Window2.ShowModal end if next end if next o

What I need is, when I do clicking the selected cell, if the ‘x’ criteria is equal with “FD” then shows the window2 form.
I’ve tried to swap the loop, but resulting outofbounds.
any help ?

Thanks
Regards,
Arief

you can’t go from listcount to 0
you go either from listcount-1 to 0
or from listcount to 1

or you get a outofbounds …

thanks, its worked now

Regards,
Arief