Hi
I want when try delete selected item for the first or last row into listbox on userform should pops message "you have not permission to do that" ,otherwise I can delete the others selected items when select the items from combobox1:3 .
here is the code
Private Sub ButtonDeleteRow_Click()
Dim i As Integer
Application.ScreenUpdating = False
If MsgBox("Are you sure you want to delete this data row?", vbYesNo + vbQuestion, "Delete Row?") = vbYes Then
Worksheets("DETAILS").Select
For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
If Cells(i, 1) = ListBox1.List(ListBox1.ListIndex) Then
Rows(i).Delete
End If
Next i
End If
Application.ScreenUpdating = True
End Sub
thanks
Bookmarks