try
Sub vbax_55475_delete_rows_via_inputbox_single_ws()
Dim Ret As Range
With Worksheets("Sheet1") 'change sheet name to suit
.Select
On Error Resume Next
Set Ret = Application.InputBox("Mark rows to be deleted", "Delete rows", Type:=8)
On Error GoTo 0
If Ret.Cells(1).Row < 6 Then
MsgBox "Rows 1-5 must not be deleted. Quitting...", vbOKOnly, "Warning!"
Exit Sub
End If
.Unprotect Password:="password"
If Not Ret Is Nothing Then Ret.EntireRow.Delete
.Protect Password:="password"
End With
End Sub
Sub vbax_55475_delete_rows_via_inputbox_multiple_wss_same_pass()
Dim ws As Worksheet
Dim Ret As Range
For Each ws In Worksheets(Array("Sheet3", "Sheet4", "Sheet6")) 'change sheet names to suit
With ws
.Select
On Error Resume Next
Set Ret = Application.InputBox("Mark rows to be deleted", "Delete rows", Type:=8)
On Error GoTo 0
If Ret.Cells(1).Row < 6 Then
MsgBox "Rows 1-5 must not be deleted. Quitting...", vbOKOnly, "Warning!"
Exit Sub
End If
.Unprotect Password:="password"
If Not Ret Is Nothing Then Ret.EntireRow.Delete
.Protect Password:="password"
End With
Next ws
End Sub
Sub vbax_55475_delete_rows_via_inputbox_multiple_wss_diff_pass()
Dim wsList, passList
Dim i As Long
Dim Ret As Range
wsList = Array("Sheet3", "Sheet4", "Sheet6") 'change sheet names to suit
passList = Array("PassWordForSheet3", "PassWordForSheet4", "PassWordForSheet6") 'change passwords to suit
For i = LBound(wsList) To UBound(wsList)
With Worksheets(wsList(i))
.Select
On Error Resume Next
Set Ret = Application.InputBox("Mark rows to be deleted", "Delete rows", Type:=8)
On Error GoTo 0
If Ret.Cells(1).Row < 6 Then
MsgBox "Rows 1-5 must not be deleted. Quitting...", vbOKOnly, "Warning!"
Exit Sub
End If
.Unprotect Password:=passList(i)
If Not Ret Is Nothing Then Ret.EntireRow.Delete
.Protect Password:=passList(i)
End With
Next ws
End Sub