View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Remove items from a listbox

Dim iRow As Long
With Me.ListBox1
On Error Resume Next
iRow = Application.Match(.Value, Range(.RowSource), 0)
On Error GoTo 0
If iRow 0 Then
Range(.RowSource).Cells(iRow, 1).EntireRow.Delete
End If
End With


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Andy" wrote in message
...
I was wondering if anyone can help me, I have a listbox on a form in excel
that has row source of a data range from one of the sheets(called LIST). I
would like to add a button to the form that when clicked will remove the
currently selected item from the listbox and also removesthe corresponding
values from the worksheet.

Also, is it possible to take the removed values and paste them elsewhere

on
the sheet?

Any help would be greatly appreciated.