1. I don't want to be able to delete rows 1-5 for this code. Some kind of dialog box that says: "You can only delete row "6" or below".
- Code: Select all
Option Explicit
Sub DeleteMe()
Dim Ret As Range, Cl As Range
On Error Resume Next
Set Ret = Application.InputBox("Mark rows to be deleted", "Delete rows", Type:=8)
On Error GoTo 0
ActiveSheet.Unprotect Password:="password"
If Not Ret Is Nothing Then Ret.EntireRow.Delete
ActiveSheet.Protect Password:="password"
End Sub
2. Another similar code as above (delete row 6 or higher) with dialog box and selection, but when I select rows in worksheet A, the same rows in worksheet B and C are also deleted.