View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] baha17@gmail.com is offline
external usenet poster
 
Posts: 80
Default list box remove item by combobox

Hi,
I have a userform which is initialized as for next and add items to listbox1 from worksheets range. Now my problem is; I would like to remove item from listbox1 by combobox1.change event. I want if the combobox1.value is equal to the item in 3rd column of listbox1.Is that possible? If so, how can I write that in a code?
PS.Above is the only simple sample which would lead me to solve my problem in my project.
Thank you very much for your help.
Here is my code below

Baha



Private Sub UserForm_Initialize()
Dim cel As Range

ComboBox1.AddItem "DLR"
ComboBox1.AddItem "DI"
ComboBox1.AddItem "SUP"

With ListBox1
For Each cel In Sheets("Sheet1").Range("A1:A100")
If cel < "" Then
..AddItem cel.Value
..List(.ListCount - 1, 1) = cel.Offset(0, 1)
..List(.ListCount - 1, 2) = cel.Offset(0, 2)
End If
Next cel
End With



End Sub