Give this a try -
Sub ClearRanges()
Dim Ans, TypedPass1 As String, TypedPass2 As String
Const Password As String = "XXX"
Ans = MsgBox("Are You Sure You Want To Clear Ranges?", vbOKCancel)
If Ans = 2 Then Exit Sub
TypedPass1 = UCase(InputBox("Input Password", "Enter Password"))
TypedPass2 = UCase(InputBox("Input Password", "Enter Password"))
If TypedPass1 <> TypedPass2 Then MsgBox "Passwords Don't Match", vbCritical: Exit Sub
If TypedPass1 <> Password Or TypedPass2 <> Password Then MsgBox "Passwords Don't Match", vbCritical: Exit Sub
If Ans = 1 And TypedPass1 = TypedPass2 And TypedPass1 = Password Then
Worksheets("Sheet1").Range("A1:G37,F9:CT9,F14:CT14").ClearContents
Worksheets("Sheet2").Range("A3:G55,F32:CT34,F13:CT77").ClearContents
End If
End Sub
Bookmarks