Removing Row of Listbox un startup

Hi,
I have data,

AS01 BS01 AS02 AS03 BS01 BS01 BS01 AS04 CS01 CS02 CS03

I want to duplicate the Listbox3 into Listbox6, and remove the row which is matched.

I put this code on window1.open

[code] 'Duplicate Listbox
Dim numrows, numcols As Int32
Dim r, c As Int32
numrows = listbox3.listcount - 1
numcols = MIN(listbox3.columncount , listbox6.columncount) -1

listbox6.deleteallrows
For r = 0 to numrows
listbox6.addrow “”
For c = 0 to numcols
listbox6.cell(r, c) = listbox3.cell(r, c)
Next c
Next r

dim o as Integer
for o=0 to Listbox6.Listcount -1
dim dd as string
dd=Listbox6.cell(o,0).Left(2)
If dd=“AS” or dd="CS"then
Listbox6.removeRow o ’ remove every row with criteria
end if
next[/code]

its do removing, but not all. I wanted to remove all the matches criteria.

any helps ?

Thanks

Arief

Do the loop backwards:

for o=Listbox6.Listcount -1 downto 0 ... next

Thanks,
Its worked!

Regards,
Arief