i would like to delete a range of cells instead of deleting entire row from list box
reason being i have other data in other rows that i don't wont to delete
range to delete A:N and keeping the data in O:R
eg row num 23 delete selected row up to Col N
and move the rows up 1
currently using this code to delete the entire row
hope this is understandable in what am trying to achieve
Dim I As VbMsgBoxResult
Dim irow As Long
If Selected_list = 0 Then
MsgBox "No Record Selected", vbOKOnly + vbInformation, "Delete"
Exit Sub
End If
irow = Application.WorksheetFunction.Match(Me.lstdatabase.List(Me.lstdatabase.ListIndex, 0), _
ThisWorkbook.Sheets("products").Range("A:A"), 0)
I = MsgBox("Do you want to delete the selected record?", vbYesNo + vbQuestion, "confirmation")
If I = vbNo Then Exit Sub
ThisWorkbook.Sheets("products").Rows(irow).Delete
Call ProductsFrmStart
MsgBox "Selected record has been Deleted", vbOKOnly + vbInformation, "Delete"
End Sub
reason being i have other data in other rows that i don't wont to delete
range to delete A:N and keeping the data in O:R
eg row num 23 delete selected row up to Col N
and move the rows up 1
currently using this code to delete the entire row
hope this is understandable in what am trying to achieve
VBA Code:
Dim irow As Long
If Selected_list = 0 Then
MsgBox "No Record Selected", vbOKOnly + vbInformation, "Delete"
Exit Sub
End If
irow = Application.WorksheetFunction.Match(Me.lstdatabase.List(Me.lstdatabase.ListIndex, 0), _
ThisWorkbook.Sheets("products").Range("A:A"), 0)
I = MsgBox("Do you want to delete the selected record?", vbYesNo + vbQuestion, "confirmation")
If I = vbNo Then Exit Sub
ThisWorkbook.Sheets("products").Rows(irow).Delete
Call ProductsFrmStart
MsgBox "Selected record has been Deleted", vbOKOnly + vbInformation, "Delete"
End Sub