LOOPING IN image combox and delete item

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

LOOPING IN image combox and delete item

Post by sal21 »

Private Sub DELETE_ITEM()

With CREPARTO1

For K = 0 To .ComboItems.Count
If REPARTO = .ComboItems.Index.Item(K) Then Stop' if is true delete current item
Next K

End With

End Sub
dont work!

User avatar
HansV
Administrator
Posts: 78235
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: LOOPING IN image combox and delete item

Post by HansV »

What exactly is the problem? Does Stop never get executed? Or does it stop at the wrong items? Or...?

(You should loop backwards if you want to delete items: For K = .ComboItems.Count To 0 Step -1)
Best wishes,
Hans