How to delete item from listbox?
On Friday, October 19, 2012 3:39:03 PM UTC-4, questionguy wrote:
I got a userform where I'd like to delete selected items. Anybody has an
idea how to?
+-------------------------------------------------------------------+
|Filename: DeleteItem.zip |
|Download: http://www.excelbanter.com/attachment.php?attachmentid=632|
+-------------------------------------------------------------------+
--
questionguy
Hi
Try this:
Private Sub cmddelete_Click()
Dim msgResponse As String, c As Range
Application.ScreenUpdating = False
msgResponse = MsgBox("This will delete the selected record. Continue?", _
vbCritical + vbYesNo, "Delete Entry")
Select Case msgResponse
Case vbYes
Set c = ActiveCell
c.Delete
Case vbNo
Exit Sub
End Select
Application.ScreenUpdating = True
End Sub
|