1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rng As Range
If Not Application.Intersect(Target, Me.Range("C2:C40")) Is Nothing Then
If ActiveCell.Value <> "" Then
passe = InputBox("Entrez votre mot de passe :")
If passe = "1234" Then
ActiveCell.Select
Else
Cells(1, "A").Select
MsgBox ("Mot de passe incorrect et Valeur exite déja et tu ne peux pas la modifier...merci de contacter Mme MAXINA")
End If
Else
For Each rng In Application.Intersect(Target, Me.Range("C2:C40"))
Application.OnKey "{DEL}", ""
Next rng
End If
Else
Application.OnKey "{DEL}"
End If
End Sub |
Partager