Option Explicit
Const BobEsponja As String = "BobEsponja1"
Const Calamardo As String = "Calamardo1"
Const Patricio As String = "Patricio1"
Const SenoraPuff As String = "SenoraPuff1"
Const SenorCangrejo As String = "SenorCangrejo1"
Const Plankton As String = "Plankton1"
Const ArenitaMejillas As String = "ArenitaMejillas1"
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim pwd As String
Dim Oops As Boolean
Application.EnableEvents = False
For Each cell In Target
If Not Intersect(cell, Range("B13")) Is Nothing And cell <> "" Then
pwd = Application.InputBox("Password for " & cell & ":", _
"Enter Password", Type:=2)
Select Case cell.Value
Case "BobEsponja"
If pwd <> BobEsponja Then Oops = True
Case "Calamardo"
If pwd <> Calamardo Then Oops = True
Case "Patricio"
If pwd <> Patricio Then Oops = True
Case "SenoraPuff"
If pwd <> SenoraPuff Then Oops = True
Case "SenorCangrejo"
If pwd <> SenorCangrejo Then Oops = True
Case "Plankton"
If pwd <> Plankton Then Oops = True
Case "ArenitaMejillas"
If pwd <> ArenitaMejillas Then Oops = True
End Select
If Oops Then
MsgBox "Bad password"
cell = ""
End If
End If
Next cell
Application.EnableEvents = True
End Sub
Bookmarks