this is what I was able to find so far, but its still not working. im shure im on the right track tho. Im trying to search subitems for text & if found remove the whole row, exept the last bold one ->item2 item12
So I have 2 columns: the problem is that the code works after item 12, until item13 is reached, then i get error InvalidArgument=Value of '1' is not valid for 'index'. Parameter name: index
thats my code.Code:Column1 Column2 item1 item11 item2 item12 item3
EDIT: see post 6 & 7 for solutionCode:For Each ListViewItem In ListView1.Items If ListViewItem.SubItems(1) Is Nothing Then MessageBox.Show("nothing") exit for Else ListView1.Items.RemoveAt(0) End If





Reply With Quote