current code ask user to be in column a and choose to delete a single entry
how can i amend so that user can select multiple rows (column A only) not necessarily consecutively to perfom the task on ultiple rows
or based on the same idea create a new sub to accomodate for deleting multiple entries
how can i amend so that user can select multiple rows (column A only) not necessarily consecutively to perfom the task on ultiple rows
or based on the same idea create a new sub to accomodate for deleting multiple entries
Rich (BB code):
Sub DeletePrintCheck()
Call WSUnProtect(Worksheets("Check Queue"))
Dim rng As Range
TryAgain:
Call WSUnProtect(Worksheets("Check Queue"))
Set rng = Application.InputBox(prompt:="Select entry you want to delete.", Type:=8)
If rng.Column <> 1 Or rng.Cells.Count <> 1 Then
MsgBox "You must be in Column A to perform the delete function."
GoTo TryAgain
End If
If MsgBox("Are you sure you want to delete: " & rng.Value & " (Row " & rng.Row & ")?", vbYesNo + vbExclamation, "Confirm Delete") = vbNo Then
Call WSProtect(Worksheets("Check Queue"))
Exit Sub
End If
Call WSUnProtect(Worksheets("Check Queue"))
Dim tbl As ListObject, LastRow As Range
Dim col As Long
Set tbl = Worksheets("Check Queue").ListObjects("tblCheckQueue")
Dim sr As Long 'Actual Row
Dim slr As Long 'Start List Row
sr = rng.Rows(1).Row
slr = sr - rng.ListObject.Range.Row 'The starting List Row
rng.ListObject.ListRows(slr).Delete
Call WSProtect(Worksheets("Check Queue"))
End Sub
Last edited by a moderator: