J
jim c.
i have a listbox on a userform whose rowsource is a named
range on sheet1. im trying the following code to delete
selected rows from named range, but will only delete first
selected item in list.
****************************************************
Private Sub CommandButton1_Click()
Dim x As Long
For x = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(x) = True Then
Sheets("sheet1").Rows(x + 1).Delete
End If
Next x
End Sub
****************************************************
how would i go about deleting all the selected rows???
range on sheet1. im trying the following code to delete
selected rows from named range, but will only delete first
selected item in list.
****************************************************
Private Sub CommandButton1_Click()
Dim x As Long
For x = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(x) = True Then
Sheets("sheet1").Rows(x + 1).Delete
End If
Next x
End Sub
****************************************************
how would i go about deleting all the selected rows???